Skip to content

Commit

Permalink
ci: don't push tmp/tag image
Browse files Browse the repository at this point in the history
  • Loading branch information
sileht committed Oct 15, 2020
1 parent 43a698c commit fd020af
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tools/build-docker-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ TARGETS[gpu]="gpu/default"
TARGETS[gpu_tf]="gpu/tf"
TARGETS[gpu_tensorrt]="gpu_tensorrt/tensorrt"

PR_NUMBER=$(echo $GIT_BRANCH | sed -n '/^PR-/s/PR-//g')
if [ "$TAG_NAME" ]; then
TMP_TAG="ci-$TAG_NAME"
elif [ "$GIT_BRANCH" == "master" ]; then
TMP_TAG="ci-$GIT_BRANCH"
elif [ "$PR_NUMBER" ]; then
TMP_TAG=ci-pr-$PR_NUMBER
else
# Not built with Jenkins
TMP_TAG="trash"
Expand Down Expand Up @@ -49,11 +52,10 @@ for name in $NAMES; do
if [ "$TAG_NAME" ]; then
docker tag $image_url:$TMP_TAG $image_url:${TAG_NAME}
docker push $image_url:${TAG_NAME}
else
elif [ "$GIT_BRANCH" == "master" ]; then
docker push $image_url:$TMP_TAG
if [ "$GIT_BRANCH" == "master" ]; then
docker tag $image_url:$TMP_TAG $image_url:latest
docker push $image_url:latest
fi

docker tag $image_url:$TMP_TAG $image_url:latest
docker push $image_url:latest
fi
done

0 comments on commit fd020af

Please sign in to comment.