#!/bin/bash -ex | |
# exit on errors | |
set -eu -o pipefail | |
DOCKER="/usr/bin/docker" | |
${DOCKER} --version | |
# set up ONOS build environment | |
ONOS_ROOT=`pwd` | |
. tools/build/envDefaults | |
# set up release build credentials | |
. onos-build-credentials | |
# get the sources | |
git checkout $GERRIT_BRANCH | |
git checkout -b docker $ONOS_TAG | |
# build and deploy the Docker image | |
$DOCKER build -t onosproject/onos:${ONOS_TAG} . | |
$DOCKER login --username ${DOCKERHUB_USERNAME} --password ${DOCKERHUB_PASSWORD} | |
$DOCKER push onosproject/onos:${ONOS_TAG} | |