summaryrefslogtreecommitdiffstats
path: root/ci/docker-update.sh
diff options
context:
space:
mode:
authorTrevor Bramwell <tbramwell@linuxfoundation.org>2017-11-10 15:25:33 -0800
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2017-11-10 15:30:05 -0800
commit48a16b2f416af135a60e92e1292bb126ba38523c (patch)
tree822f6f5f93dbc322779eab552a335bb33184b2c4 /ci/docker-update.sh
parent5dba82b4e8b5560eb726603d290698ca4c22ea11 (diff)
Initial Commit CI Files
These files come from the releng repository and are used in the automated deploy of testapi. Moving them into this repository removes the need to clone multiple repositories when deploying the testapi site and verifying the repository. Change-Id: Ibd54c47bd76e3f2d801cfb4eaaeb1623bd1ae7b9 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Diffstat (limited to 'ci/docker-update.sh')
-rw-r--r--ci/docker-update.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/ci/docker-update.sh b/ci/docker-update.sh
new file mode 100644
index 0000000..6c6a554
--- /dev/null
+++ b/ci/docker-update.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one *
+# or more contributor license agreements. See the NOTICE file *
+# distributed with this work for additional information *
+# regarding copyright ownership. The ASF licenses this file *
+# to you under the Apache License, Version 2.0 (the *
+# "License"); you may not use this file except in compliance *
+# with the License. You may obtain a copy of the License at *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0 *
+# *
+# Unless required by applicable law or agreed to in writing, *
+# software distributed under the License is distributed on an *
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+# KIND, either express or implied. See the License for the *
+# specific language governing permissions and limitations *
+# under the License. *
+
+set -o errexit
+set -o nounset
+
+cd $WORKSPACE/$MODULE_NAME/docker/
+
+# Remove previous containers
+docker ps -a | grep "opnfv/$MODULE_NAME" | awk '{ print $1 }' | xargs -r docker rm -f
+
+# Remove previous images
+docker images | grep "opnfv/$MODULE_NAME" | awk '{ print $3 }' | xargs -r docker rmi -f
+
+# Start build
+docker build --no-cache -t opnfv/$MODULE_NAME:$DOCKER_TAG .
+
+# Push Image
+docker push opnfv/$MODULE_NAME:$DOCKER_TAG