Yuta HIGUCHI | 4e751d0 | 2018-05-11 10:22:11 -0700 | [diff] [blame] | 1 | #!/bin/bash -e |
Ray Milkey | 0caba7f | 2018-01-08 12:56:18 -0800 | [diff] [blame] | 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 | 545efe9 | 2018-01-26 10:41:00 -0800 | [diff] [blame] | 16 | # 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} |