summaryrefslogtreecommitdiffstats
path: root/jjb/opnfv
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-04-25 11:02:11 +0200
committerjose.lausuch <jose.lausuch@ericsson.com>2016-04-25 11:03:50 +0200
commit869b61e937862b1070ab3b5789a7c23a7992e94d (patch)
tree78b8306536621938c54febb7da1a8dd4ad41e1c4 /jjb/opnfv
parent7d03038f3fa3d8daefcf8cfff15afb2d86cdf47e (diff)
Avoid colissions between docker-build jobs
Problem to be fixed: if the job detects that there is another docker-build in progress it will exit but won't be triggered again until it detects a new commit in the repo. Change-Id: Ifee419f50fa9d4cb21825302688e1af3311c4bb9 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'jjb/opnfv')
-rw-r--r--jjb/opnfv/opnfv-docker.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/jjb/opnfv/opnfv-docker.sh b/jjb/opnfv/opnfv-docker.sh
index 8f44268e6..702c0ce52 100644
--- a/jjb/opnfv/opnfv-docker.sh
+++ b/jjb/opnfv/opnfv-docker.sh
@@ -17,6 +17,14 @@ echo "--------------------------------------------------------"
echo
+if [[ -n $(ps -ef|grep 'docker build'|grep -v grep) ]]; then
+ echo "There is already another build process in progress:"
+ echo $(ps -ef|grep 'docker build'|grep -v grep)
+ # Abort this job since it will colide and might mess up the current one.
+ echo "Aborting..."
+ exit 1
+fi
+
# Remove previous running containers if exist
if [[ -n "$(docker ps -a | grep $DOCKER_REPO_NAME)" ]]; then
echo "Removing existing $DOCKER_REPO_NAME containers..."