diff options
author | Jose Lausuch <jose.lausuch@ericsson.com> | 2017-03-31 07:49:08 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-03-31 07:49:08 +0000 |
commit | 56cc657f8cd3ed250500d90ea33da1560d90033f (patch) | |
tree | 3cf140b0246cec9412b834680227849011e46c10 /jjb | |
parent | 8eb68cff96445dc53ee1c232b565aa4a61d0a526 (diff) | |
parent | a50587afb806c512994f1395cdff34df53e045b2 (diff) |
Merge "Add wait method for Docker builds"
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/releng/opnfv-docker.sh | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/jjb/releng/opnfv-docker.sh b/jjb/releng/opnfv-docker.sh index 9bd711bc6..5d73a9d70 100644 --- a/jjb/releng/opnfv-docker.sh +++ b/jjb/releng/opnfv-docker.sh @@ -17,14 +17,16 @@ echo "Starting opnfv-docker for $DOCKER_REPO_NAME ..." 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 collide and might mess up the current one. - echo "Aborting..." - exit 1 -fi +count=30 # docker build jobs might take up to ~30 min +while [[ -n `ps -ef|grep 'docker build'|grep -v grep` ]]; do + echo "Build in progress. Waiting..." + sleep 60 + count=$(( $count - 1 )) + if [ $count -eq 0 ]; then + echo "Timeout. Aborting..." + exit 1 + fi +done # Remove previous running containers if exist if [[ -n "$(docker ps -a | grep $DOCKER_REPO_NAME)" ]]; then |