Add a docker build job
Change-Id: I4519f4275028dc0512ae2efc1f9260447fbb6668
diff --git a/jjb/onos/onos-docker-build.sh b/jjb/onos/onos-docker-build.sh
new file mode 100644
index 0000000..15c1f9d
--- /dev/null
+++ b/jjb/onos/onos-docker-build.sh
@@ -0,0 +1,19 @@
+#!/bin/bash -ex
+
+# exit on errors
+set -eu -o pipefail
+
+# set up ONOS build environment
+ONOS_ROOT=`pwd`
+. tools/build/envDefaults
+
+# get the sources
+git checkout $GERRIT_BRANCH
+
+# run the build
+onos-buck build onos
+
+# build and deploy the Docker image
+docker build -t onosproject/onos:${ONOS_VERSION} .
+docker login --username ${DOCKERHUB_USERNAME} --password ${DOCKERHUB_PASSWORD}
+docker push onosproject/onos:${ONOS_VERSION}
diff --git a/jjb/onos/onos-verify.yaml b/jjb/onos/onos-verify.yaml
index e8cd489..efb7f10 100644
--- a/jjb/onos/onos-verify.yaml
+++ b/jjb/onos/onos-verify.yaml
@@ -302,6 +302,44 @@
- job-template:
#default name is global
+ name: 'onos-docker-build'
+
+ # Job template for Docker jobs
+ #
+
+ <<: *job_boiler_plate
+ # yamllint disable-line rule:key-duplicates
+ <<: *release_build_boiler_plate
+
+ builders:
+ - lf-provide-maven-settings:
+ settings-file: 'release-build-maven-settings'
+ global-settings-file: 'release-build-maven-settings'
+ - config-file-provider:
+ files:
+ - file-id: 'onos-build-credentials'
+ target: 'onos-build-credentials'
+ variable: 'CREDENTIALS_FILE'
+ - file-id: 'buck-config-local'
+ target: '.buckconfig.local'
+ variable: 'BUCK_CONFIG_FILE'
+ - file-id: 'gpg-key'
+ target: 'jenkins.key'
+ variable: 'GPG_KEY_FILE'
+ - file-id: 'release-build-maven-settings'
+ target: 'settings.xml'
+ variable: 'MAVEN_SETTINGS'
+ - file-id: 'api-onosproject-ssh-key'
+ target: 'id_rsa.pub'
+ variable: 'API_ONOSPROJECT_SSH_KEY'
+
+ #put shell scripts in file then make sure shell check is installed on verify vms
+ - shell: !include-raw-escape: onos-docker-build.sh
+ # JJB 1.6.2 does not support parameter expansion on filename?
+ #- shell: !include-raw-escape: {project-name}-verify.sh
+
+- job-template:
+ #default name is global
name: 'onos-{stream}-maven-verify'
<<: *job_boiler_plate
@@ -458,3 +496,16 @@
jobs:
- 'onos-release-build'
+
+- project:
+ name: onos-docker-build
+ project-name: onos-docker-build
+ project: onos
+
+ build-timeout: '1800'
+ build-node: 'ubuntu16.04-basebuild-8c-15g'
+
+ stream: 'master'
+
+ jobs:
+ - 'onos-docker-build'