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:
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/trafficcontrol
):
cd infrastructure/docker/build docker-compose build traffic_ops_build traffic_monitor_build ... GITREPO=https://github.com/username/trafficcontrol BRANCH=mybranch docker-compose up traffic_ops_build traffic_monitor_build ...
The resulting .rpm
files will be created in the artifacts
directory.
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.
These build scripts depend on the text in the VERSION file along with the BUILD_NUMBER described below to name each rpm.
The build scripts use environment variables to control how the build is done. These have sensible defaults listed below, and it is recommended to not override them:
At the conclusion of the build, all rpms are copied into the $WORKSPACE/dist directory.
Building using docker
is experimental at this time and has not been fully vetted.
Dockerfiles for each sub-project are located in the build directory (e.g. traffic_ops/build/Dockerfile
)
GITREPO
(default is https://github.com/Comcast/traffic_control
) and BRANCH
(default is master).export GITHUB_REPO=https://github.com/myuser/traffic_control export BRANCH=feature/my-new-feature ./build/docker-build.sh