Instead of defining docker build jobs in terms of projects, we define
them in terms of dockerrepos. Each dockerrepo is associated with a
specific project and may have a seperate Dockerfile (which defaults to
'Dockerfile' if unspecified), and location for files needed by the
Dockerfile (default: 'docker').
This should allow for running multiple docker builds out of a single
project repository without having to modify the current docker build
scripts.
The output of this job configuration should match what is currently in
Jenkins.
Change-Id: I9089d57a0c7cc56be4225b56e96bec56be258f1f
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
name: RELEASE_VERSION
default: ""
description: "Release version, e.g. 1.0, 2.0, 3.0"
name: RELEASE_VERSION
default: ""
description: "Release version, e.g. 1.0, 2.0, 3.0"
+ - string:
+ name: DOCKER_DIR
+ default: "docker"
+ description: "Directory containing files needed by the Dockerfile"
- string:
name: DOCKERFILE
default: "Dockerfile.aarch64"
- string:
name: DOCKERFILE
default: "Dockerfile.aarch64"
+cd $WORKSPACE/$DOCKER_DIR
HOST_ARCH=$(uname -m)
if [ ! -f "${DOCKERFILE}" ]; then
# If this is expected to be a Dockerfile for other arch than x86
HOST_ARCH=$(uname -m)
if [ ! -f "${DOCKERFILE}" ]; then
# If this is expected to be a Dockerfile for other arch than x86
other-receivers: &other-receivers
receivers: ''
other-receivers: &other-receivers
receivers: ''
+ dockerfile: "Dockerfile"
+ dockerdir: "docker"
+
+ # This is the dockerhub repo the image will be pushed to as
+ # 'opnfv/{dockerrepo}. See: DOCKER_REPO_NAME parameter.
+ # 'project' is the OPNFV repo we expect to contain the Dockerfile
+ dockerrepo:
# projects with jobs for master
- 'releng-anteater':
# projects with jobs for master
- 'releng-anteater':
+ project: 'releng-anteater'
<<: *master
<<: *other-receivers
- 'bottlenecks':
<<: *master
<<: *other-receivers
- 'bottlenecks':
<<: *master
<<: *other-receivers
- 'cperf':
<<: *master
<<: *other-receivers
- 'cperf':
<<: *master
<<: *other-receivers
- 'dovetail':
<<: *master
<<: *other-receivers
- 'dovetail':
<<: *master
<<: *other-receivers
- 'functest':
<<: *master
<<: *other-receivers
- 'functest':
<<: *master
<<: *functest-receivers
- 'qtip':
<<: *master
<<: *functest-receivers
- 'qtip':
<<: *master
<<: *other-receivers
- 'storperf':
<<: *master
<<: *other-receivers
- 'storperf':
<<: *master
<<: *other-receivers
- 'yardstick':
<<: *master
<<: *other-receivers
- 'yardstick':
<<: *master
<<: *other-receivers
# projects with jobs for stable
- 'bottlenecks':
<<: *master
<<: *other-receivers
# projects with jobs for stable
- 'bottlenecks':
<<: *danube
<<: *other-receivers
- 'functest':
<<: *danube
<<: *other-receivers
- 'functest':
<<: *danube
<<: *functest-receivers
- 'qtip':
<<: *danube
<<: *functest-receivers
- 'qtip':
<<: *danube
<<: *other-receivers
- 'storperf':
<<: *danube
<<: *other-receivers
- 'storperf':
<<: *danube
<<: *other-receivers
- 'yardstick':
<<: *danube
<<: *other-receivers
- 'yardstick':
<<: *danube
<<: *other-receivers
jobs:
<<: *danube
<<: *other-receivers
jobs:
- - '{project}-docker-build-push-{stream}'
+ - "{dockerrepo}-docker-build-push-{stream}"
- project:
name: opnfv-monitor-docker # projects which only monitor dedicated file or path
- project:
name: opnfv-monitor-docker # projects which only monitor dedicated file or path
+ dockerfile: "Dockerfile"
+ dockerdir: "docker"
+
project:
# projects with jobs for master
- 'daisy':
project:
# projects with jobs for master
- 'daisy':
<<: *master
- 'escalator':
<<: *master
- 'escalator':
+ dockerrepo: 'escalator'
# job templates
########################
- job-template:
# job templates
########################
- job-template:
- name: '{project}-docker-build-push-{stream}'
+ name: '{dockerrepo}-docker-build-push-{stream}'
disabled: '{obj:disabled}'
disabled: '{obj:disabled}'
description: "To enable/disable pushing the image to Dockerhub."
- string:
name: DOCKER_REPO_NAME
description: "To enable/disable pushing the image to Dockerhub."
- string:
name: DOCKER_REPO_NAME
- default: "opnfv/{project}"
+ default: "opnfv/{dockerrepo}"
description: "Dockerhub repo to be pushed to."
description: "Dockerhub repo to be pushed to."
+ - string:
+ name: DOCKER_DIR
+ default: "{dockerdir}"
+ description: "Directory containing files needed by the Dockerfile"
- string:
name: COMMIT_ID
default: ""
- string:
name: COMMIT_ID
default: ""
description: "Release version, e.g. 1.0, 2.0, 3.0"
- string:
name: DOCKERFILE
description: "Release version, e.g. 1.0, 2.0, 3.0"
- string:
name: DOCKERFILE
+ default: "{dockerfile}"
description: "Dockerfile to use for creating the image."
scm:
description: "Dockerfile to use for creating the image."
scm: