Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@

# Rpm Build Instructions

## Using `docker-compose`

We are moving toward using a docker-based build system. This eliminates the need to maintain a local installation with all the
build tools as well as ensuring that you are using the same versions as we use for testing.

These are the versions of these tools we are using:
* docker 1.12.2
* docker-compose 1.8.1

You can build from any repository/branch combination, but that repository must be available to `git clone ...`. Note that in the
following `docker-compose` commands, you can limit building to one or more sub-projects by supplying arguments at the end. If none
are supplied, then *all* will be run.

Starting at the top-level of your trafficcontrol git clone (e.g. `~/src/incubator-trafficcontrol`):

> cd infrastructure/docker/build
> docker-compose build traffic_ops_build traffic_monitor_build ...
> GITREPO=https://github.com/username/incubator-trafficcontrol BRANCH=mybranch docker-compose up traffic_ops_build traffic_monitor_build ...

The resulting `.rpm` files will be created in the `artifacts` directory.


## Building the old-fashioned way

rpm files for all sub-projects can be built using the file `build/build.sh`. If this script is given parameters, it will build only
those projects specified on the command line, e.g. `$ ./build/build.sh traffic_ops`. The prerequisites for each sub-project are
listed below.
Expand Down
94 changes: 0 additions & 94 deletions build/docker-build.sh

This file was deleted.

2 changes: 1 addition & 1 deletion infrastructure/docker/build/Dockerfile-traffic_monitor
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN yum -y install \
rpm-build && \
yum -y clean all

ENV GITREPO=https://github.com/Comcast/traffic_control
ENV GITREPO=https://github.com/apache/incubator-trafficcontrol
ENV BRANCH=master

# Above are common for all sub-projects.
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/docker/build/Dockerfile-traffic_ops
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN yum install -y \


# all ENV vars can be controlled by, e.g. `docker run -e BRANCH=1.6.x <image>`
ENV GITREPO=https://github.com/Comcast/traffic_control
ENV GITREPO=https://github.com/apache/incubator-trafficcontrol
ENV BRANCH=master

WORKDIR /repo
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/docker/build/Dockerfile-traffic_portal
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN yum -y install \
rpm-build && \
yum -y clean all

ENV GITREPO https://github.com/Comcast/traffic_control
ENV GITREPO https://github.com/apache/incubator-trafficcontrol
ENV BRANCH master

WORKDIR /repo
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/docker/build/Dockerfile-traffic_router
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN yum -y install \
rpm-build && \
yum -y clean all

ENV GITREPO https://github.com/Comcast/traffic_control
ENV GITREPO https://github.com/apache/incubator-trafficcontrol
ENV BRANCH master

WORKDIR /repo
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/docker/build/Dockerfile-traffic_stats
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN yum -y install \
rpm-build && \
yum -y clean all

ENV GITREPO https://github.com/Comcast/traffic_control
ENV GITREPO https://github.com/apache/incubator-trafficcontrol
ENV BRANCH master

WORKDIR /repo
Expand Down
6 changes: 3 additions & 3 deletions infrastructure/docker/build/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

# Building *traffic_control* using *docker-compose*
# Building *trafficcontrol* using *docker-compose*

- install `docker-engine` and `docker-compose`
- `cd traffic_control/infrastructure/docker/build`
- `export GITREPO=https://github.com/<username>/traffic_control`
- `cd incubator-trafficcontrol/infrastructure/docker/build`
- `export GITREPO=https://github.com/<username>/incubator-trafficcontrol`
- `export BRANCH=mynewbranch`
- `docker-compose up traffic_monitor_build traffic_ops_build ...`
- new rpm files will be in `./artifacts`
6 changes: 3 additions & 3 deletions infrastructure/docker/build/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---

# Build configuration for traffic_control
# Build configuration for trafficcontrol
# Usage:
# GITREPO=... BRANCH=... docker-compose up [<service>...]
#
# where GITREPO is https path to traffic_control clone
# (default: https://github.com/Comcast/traffic_control)
# where GITREPO is https path to trafficcontrol clone
# (default: https://github.com/apache/incubator-trafficcontrol)
# and <branch> is name of branch to test
# (default: master).
#
Expand Down
9 changes: 5 additions & 4 deletions infrastructure/docker/build/run-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ target=$1
[[ -z $target ]] && echo "No target specified"
echo "Building $target"

echo "GITREPO=${GITREPO:=https://github.com/Comcast/traffic_control}"
echo "GITREPO=${GITREPO:=https://github.com/apache/incubator-trafficcontrol}"
echo "BRANCH=${BRANCH:=master}"

dir=$(basename $GITREPO)
set -x
git clone $GITREPO -b $BRANCH traffic_control
git clone "$GITREPO" -b "$BRANCH" $dir || echo "Clone failed: $!"

cd traffic_control/$target
cd $dir/$target
./build/build_rpm.sh
mkdir -p /artifacts
cp ../dist/* /artifacts/.

# Clean up for next build
cd -
rm -r traffic_control
rm -r $dir