blob: be2248e3dfae06b6de3936cfd4957ecdc59c4cfa [file] [log] [blame]
Yuta HIGUCHI4e751d02018-05-11 10:22:11 -07001#!/bin/bash -e
Ray Milkey0caba7f2018-01-08 12:56:18 -08002
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 Milkey545efe92018-01-26 10:41:00 -080016# 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}