Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This job publishes dev-env to a specified registry. The container is built based on specific sandbox_branch. Change-Id: I2684570d4b50d795fb586283bb99812038d103b0 Partial-Bug: #1783332
- Loading branch information
Showing
10 changed files
with
63 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
#!/bin/bash | ||
BRANCH=master | ||
IMAGE=opencontrail/developer-sandbox | ||
|
||
while getopts ":b:" opt; do | ||
while getopts ":b:i:" opt; do | ||
case $opt in | ||
b) BRANCH=$OPTARG | ||
;; | ||
i) IMAGE=$OPTARG | ||
;; | ||
\?) echo "Invalid option: $opt"; exit 1;; | ||
esac | ||
done | ||
|
||
shift $((OPTIND-1)) | ||
|
||
TAG=${1:-centos-7.4} | ||
echo Building contrail-dev-env image: opencontrail/developer-sandbox:${TAG} | ||
docker build --build-arg BRANCH=${BRANCH} --no-cache --tag opencontrail/developer-sandbox:${TAG} . | ||
TAG=${1:-latest} | ||
echo Building contrail-dev-env image: ${IMAGE}:${TAG} | ||
docker build --build-arg BRANCH=${BRANCH} --no-cache --tag ${IMAGE}:${TAG} . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
- hosts: all | ||
roles: | ||
- zuul-include-vars | ||
- role: add-insecure-registry | ||
new_registry: "{{ contrail_docker_registry }}" | ||
|
||
- hosts: all | ||
name: Publish containers to the internal registry | ||
roles: | ||
- role: publish-container-images | ||
registry: "{{ contrail_docker_registry }}" | ||
tag: "{{ packaging.docker_version }}" | ||
images: | ||
- name: "{{ image_name }}" | ||
tag: "{{ image_tag }}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
container_tag: "{{ zuul.change }}-{{ zuul.patchset }}-{{ zuul.buildset[0:9] }}" | ||
image_tag: "{{ packaging.docker_version }}" | ||
image_name: "opencontrailnightly/developer-sandbox" | ||
sandbox_branch: "{{ zuul.branch }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
image_tag: "{{ packaging.docker_version }}" | ||
image_name: "opencontrailnightly/developer-sandbox" | ||
image_target: "opencontrail/developer-sandbox" | ||
sandbox_branch: "{{ zuul.branch }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
|
||
- name: Retag developer-sandbox | ||
command: > | ||
docker tag {{ image_name }}:{{ image_tag }} | ||
{{ image_target }}:{{ sandbox_branch }} | ||
become: true | ||
|
||
- name: Push developer-sandbox | ||
command: > | ||
docker push {{ image_target }}:{{ sandbox_branch }} | ||
become: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
container_tag: "{{ zuul.change }}-{{ zuul.patchset }}-{{ zuul.buildset[0:9] }}" | ||
image_tag: "{{ packaging.docker_version }}" | ||
image_name: "opencontrailnightly/developer-sandbox" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters