diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2017-01-19 07:16:36 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-01-19 07:16:36 +0000 |
commit | d48d8be23dd95b4ceaf12561d5eef08fd7907806 (patch) | |
tree | 0a0ce386180c17d21548f447761c30e9a8c95b74 /jjb | |
parent | 920091e23e0beea236ffc658db9d9ecb8a9891b9 (diff) | |
parent | 3549b847cd28995dc232e6468c911503f628fda3 (diff) |
Merge "Add docker update builder to jenkins job"
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/releng/testapi-automate.yml | 11 | ||||
-rw-r--r-- | jjb/releng/testapi-docker-update.sh | 18 |
2 files changed, 29 insertions, 0 deletions
diff --git a/jjb/releng/testapi-automate.yml b/jjb/releng/testapi-automate.yml index 0566c3fd6..376288505 100644 --- a/jjb/releng/testapi-automate.yml +++ b/jjb/releng/testapi-automate.yml @@ -16,6 +16,10 @@ project: '{project}' - gerrit-parameter: branch: '{branch}' + - string: + name: DOCKER_TAG + default: "latest" + description: "Tag name for testapi docker image" - 'opnfv-build-defaults' scm: @@ -39,6 +43,7 @@ pattern: 'utils/**' builders: + - docker-update - start-testapi-server - testapi-doc-build - upload-doc-artifact @@ -49,6 +54,12 @@ ################################ - builder: + name: docker-update + builders: + - shell: | + bash ./jjb/releng/testapi-docker-update.sh + +- builder: name: testapi-doc-build builders: - shell: | diff --git a/jjb/releng/testapi-docker-update.sh b/jjb/releng/testapi-docker-update.sh new file mode 100644 index 000000000..84f5c3217 --- /dev/null +++ b/jjb/releng/testapi-docker-update.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -o errexit +set -o nounset + +cd $WORKSPACE/utils/test/testapi/docker/ + +# Remove previous containers +docker ps -a | grep "opnfv/testapi" | awk '{ print $1 }' | xargs -r docker rm -f + +# Remove previous images +docker images | grep "opnfv/testapi" | awk '{ print $3 }' | xargs -r docker rmi -f + +# Start build +docker build --no-cache -t opnfv/testapi:$DOCKER_TAG . + +# Push Image +docker push opnfv/testapi:$DOCKER_TAG |