Ray Milkey | 0caba7f | 2018-01-08 12:56:18 -0800 | [diff] [blame] | 1 | #!/bin/bash -ex |
| 2 | |
| 3 | # exit on errors |
| 4 | set -eu -o pipefail |
| 5 | |
Ray Milkey | e3f9ad4 | 2018-01-08 14:21:44 -0800 | [diff] [blame] | 6 | DOCKER="/usr/bin/docker" |
| 7 | ${DOCKER} --version |
| 8 | |
Ray Milkey | 0caba7f | 2018-01-08 12:56:18 -0800 | [diff] [blame] | 9 | # set up ONOS build environment |
| 10 | ONOS_ROOT=`pwd` |
| 11 | . tools/build/envDefaults |
| 12 | |
Ray Milkey | 4840a30 | 2018-01-08 16:11:02 -0800 | [diff] [blame] | 13 | # set up release build credentials |
| 14 | . onos-build-credentials |
| 15 | |
Ray Milkey | b40e567 | 2018-01-26 10:10:45 -0800 | [diff] [blame^] | 16 | on# get the sources |
Ray Milkey | 0caba7f | 2018-01-08 12:56:18 -0800 | [diff] [blame] | 17 | git checkout $GERRIT_BRANCH |
Ray Milkey | b40e567 | 2018-01-26 10:10:45 -0800 | [diff] [blame^] | 18 | git checkout -b docker $ONOS_TAG |
Ray Milkey | 0caba7f | 2018-01-08 12:56:18 -0800 | [diff] [blame] | 19 | |
Ray Milkey | c0d2236 | 2018-01-08 13:51:07 -0800 | [diff] [blame] | 20 | # build and deploy the Docker image |
Ray Milkey | b40e567 | 2018-01-26 10:10:45 -0800 | [diff] [blame^] | 21 | $DOCKER build -t onosproject/onos:${ONOS_TAG} . |
Ray Milkey | c0d2236 | 2018-01-08 13:51:07 -0800 | [diff] [blame] | 22 | $DOCKER login --username ${DOCKERHUB_USERNAME} --password ${DOCKERHUB_PASSWORD} |
Ray Milkey | b40e567 | 2018-01-26 10:10:45 -0800 | [diff] [blame^] | 23 | $DOCKER push onosproject/onos:${ONOS_TAG} |
Ray Milkey | c0d2236 | 2018-01-08 13:51:07 -0800 | [diff] [blame] | 24 | |