summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jjb/releng/testapi-automate.yml11
-rw-r--r--jjb/releng/testapi-docker-update.sh18
2 files changed, 29 insertions, 0 deletions
diff --git a/jjb/releng/testapi-automate.yml b/jjb/releng/testapi-automate.yml
index 2a2f7b6d4..9139394ed 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