blob: b0e17535089cee34180cd4cb93aec347af871fd5 [file] [log] [blame]
Ray Milkey0caba7f2018-01-08 12:56:18 -08001#!/bin/bash -ex
2
3# exit on errors
4set -eu -o pipefail
5
Ray Milkeye3f9ad42018-01-08 14:21:44 -08006DOCKER="/usr/bin/docker"
7${DOCKER} --version
8
Ray Milkey0caba7f2018-01-08 12:56:18 -08009# set up ONOS build environment
10ONOS_ROOT=`pwd`
11. tools/build/envDefaults
12
Ray Milkey4840a302018-01-08 16:11:02 -080013# set up release build credentials
14. onos-build-credentials
15
Ray Milkeyb40e5672018-01-26 10:10:45 -080016on# get the sources
Ray Milkey0caba7f2018-01-08 12:56:18 -080017git checkout $GERRIT_BRANCH
Ray Milkeyb40e5672018-01-26 10:10:45 -080018git checkout -b docker $ONOS_TAG
Ray Milkey0caba7f2018-01-08 12:56:18 -080019
Ray Milkeyc0d22362018-01-08 13:51:07 -080020# build and deploy the Docker image
Ray Milkeyb40e5672018-01-26 10:10:45 -080021$DOCKER build -t onosproject/onos:${ONOS_TAG} .
Ray Milkeyc0d22362018-01-08 13:51:07 -080022$DOCKER login --username ${DOCKERHUB_USERNAME} --password ${DOCKERHUB_PASSWORD}
Ray Milkeyb40e5672018-01-26 10:10:45 -080023$DOCKER push onosproject/onos:${ONOS_TAG}
Ray Milkeyc0d22362018-01-08 13:51:07 -080024