tree: ef34b5dada5551374e61aefa059e39ff0b496b07 [path history] [tgz]
  1. build.sh
  2. functions.sh
  3. README.md
build/README.md

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/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.

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.

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:

  • WORKSPACE
    • defaults to the top level of the traffic_control directory. The dist and rpmbuild directories are created in this directory during the rpm build process.
  • BUILD_NUMBER
    • generates build number from the number of commits on the current git branch followed by the 8 character short commit hash of the last commit on the branch.This number is used to create the rpm version, e.g. traffic_ops.1.2.0.1723.a18e2bb7.

At the conclusion of the build, all rpms are copied into the $WORKSPACE/dist directory.

Prerequisites for building:

all sub-projects

  • CentOS 6.x
  • rpmbuild (yum install rpm-build)
  • git 1.7.12 or higher

traffic_ops:

  • perl 5.10 or higher
  • go 1.7 or higher

traffic_stats:

  • go 1.7 or higher

traffic_monitor and traffic_router:

  • java-1.8.0-openjdk and java-1.8.0-openjdk-devel
  • apache-maven 3.3.1 or higher

traffic_monitor_golang:

  • go 1.7 or higher

traffic_portal

  • npm (yum install npm)
    • bower (npm install -g bower)
    • grunt (npm install -g grunt)

Docker build instructions

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)

Optionally set these environment variables to control the source to start with:

  • 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