summaryrefslogtreecommitdiffstats
path: root/jjb/opnfv/opnfv-docker.sh
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/opnfv/opnfv-docker.sh')
-rw-r--r--jjb/opnfv/opnfv-docker.sh52
1 files changed, 9 insertions, 43 deletions
diff --git a/jjb/opnfv/opnfv-docker.sh b/jjb/opnfv/opnfv-docker.sh
index e637f7b32..e0fbb7564 100644
--- a/jjb/opnfv/opnfv-docker.sh
+++ b/jjb/opnfv/opnfv-docker.sh
@@ -20,7 +20,7 @@ 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.
+ # Abort this job since it will collide and might mess up the current one.
echo "Aborting..."
exit 1
fi
@@ -51,20 +51,6 @@ if [[ -n "$(docker images | grep $DOCKER_REPO_NAME)" ]]; then
done
fi
-# If we just want to update the latest_stable image
-if [[ "$UPDATE_LATEST_STABLE" == "true" ]]; then
- echo "Pulling $DOCKER_REPO_NAME:$STABLE_TAG ..."
- docker pull $DOCKER_REPO_NAME:$STABLE_TAG
- if [[ $? -ne 0 ]]; then
- echo "ERROR: The image $DOCKER_REPO_NAME with tag $STABLE_TAG does not exist."
- exit 1
- fi
- docker tag $DOCKER_REPO_NAME:$STABLE_TAG $DOCKER_REPO_NAME:latest_stable
- echo "Pushing $DOCKER_REPO_NAME:latest_stable ..."
- docker push $DOCKER_REPO_NAME:latest_stable
- exit 0
-fi
-
# cd to directory where Dockerfile is located
cd $WORKSPACE/docker
@@ -78,35 +64,20 @@ branch="${GIT_BRANCH##origin/}"
echo "Current branch: $branch"
if [[ "$branch" == "master" ]]; then
- DOCKER_TAG="master"
- DOCKER_BRANCH_TAG="latest"
+ DOCKER_TAG="latest"
else
- git clone https://gerrit.opnfv.org/gerrit/releng $WORKSPACE/releng
-
- DOCKER_TAG=$($WORKSPACE/releng/utils/calculate_version.sh -t docker \
- -n $DOCKER_REPO_NAME)
- DOCKER_BRANCH_TAG="stable"
-
- ret_val=$?
- if [[ $ret_val -ne 0 ]]; then
- echo "Error retrieving the version tag."
- exit 1
- fi
+ DOCKER_TAG="stable"
fi
-echo "Tag version to be build and pushed: $DOCKER_TAG"
-
# Start the build
-echo "Building docker image: $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG"
+echo "Building docker image: $DOCKER_REPO_NAME:$DOCKER_TAG"
+echo "--------------------------------------------------------"
+echo
+cmd="docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_TAG --build-arg BRANCH=$branch ."
-if [[ $DOCKER_REPO_NAME == *"functest"* ]]; then
- docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG --build-arg BRANCH=$branch .
-else
- docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG .
-fi
+echo ${cmd}
+${cmd}
-echo "Creating tag '$DOCKER_TAG'..."
-docker tag $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG $DOCKER_REPO_NAME:$DOCKER_TAG
# list the images
echo "Available images are:"
@@ -117,10 +88,5 @@ if [[ "$PUSH_IMAGE" == "true" ]]; then
echo "Pushing $DOCKER_REPO_NAME:$DOCKER_TAG to the docker registry..."
echo "--------------------------------------------------------"
echo
- # Push to the Dockerhub repository
- echo "Pushing $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG ..."
- docker push $DOCKER_REPO_NAME:$DOCKER_BRANCH_TAG
-
- echo "Pushing $DOCKER_REPO_NAME:$DOCKER_TAG ..."
docker push $DOCKER_REPO_NAME:$DOCKER_TAG
fi