summaryrefslogtreecommitdiffstats
path: root/jjb/releng/testapi-docker-update.sh
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/releng/testapi-docker-update.sh
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/releng/testapi-docker-update.sh')
-rw-r--r--jjb/releng/testapi-docker-update.sh18
1 files changed, 18 insertions, 0 deletions
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