summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
authorrohitsakala <rohitsakala@gmail.com>2017-01-16 10:25:49 +0530
committerrohitsakala <rohitsakala@gmail.com>2017-01-17 17:20:52 +0530
commit3549b847cd28995dc232e6468c911503f628fda3 (patch)
tree8ebb79f7ab8ba89f0e660d28c5655460aca4cbe8 /jjb
parentd8fbf3739d441c9c3388a5543bb7f6a1c282cf1d (diff)
Add docker update builder to jenkins job
JIRA: FUNCTEST-688 Change-Id: I67717f4a7ecfdc0c7bfbb5ed664aa6573c02d463 Signed-off-by: rohitsakala <rohitsakala@gmail.com>
Diffstat (limited to 'jjb')
-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