Skip to content

Commit

Permalink
Merge pull request RocketChat#561 from assistify/fix/RocketChat#560-U…
Browse files Browse the repository at this point in the history
…pdate-circle-ci-preview-image

Skip docker image build for tags
  • Loading branch information
mrsimpson authored Jan 21, 2019
2 parents 62a827e + cee2b32 commit cead1eb
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,36 +273,36 @@ jobs:
rm Rocket.Chat.tar.gz
export CIRCLE_TAG=${CIRCLE_TAG:=}
if [[ $CIRCLE_TAG ]]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
echo "Build official Docker image"
cp ~/repo/.docker/Dockerfile .
docker build -t assistify/chat:$CIRCLE_TAG .
docker push assistify/chat:$CIRCLE_TAG
# echo "Build preview Docker image"
# cp ~/repo/.docker-mongo/Dockerfile .
# cp ~/repo/.docker-mongo/entrypoint.sh .
# docker build -t assistify/chat.preview:$CIRCLE_TAG .
# docker push assistify/chat.preview:$CIRCLE_TAG
if echo "$CIRCLE_TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]-[0-9]+\.[0-9]+\.[0-9]+$' ; then
docker tag assistify/chat:$CIRCLE_TAG assistify/chat:latest
docker push assistify/chat:latest
docker tag assistify/chat.preview:$CIRCLE_TAG assistify/chat.preview:latest
docker push assistify/chat.preview:latest
elif echo "$CIRCLE_TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]-[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$' ; then
docker tag assistify/chat:$CIRCLE_TAG assistify/chat:release-candidate
docker push assistify/chat:release-candidate
docker tag assistify/chat.preview:$CIRCLE_TAG assistify/chat.preview:release-candidate
docker push assistify/chat.preview:release-candidate
fi
exit 0
fi;
if [[ $CIRCLE_TAG ]]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
echo "Build official Docker image"
cp ~/repo/.docker/Dockerfile .
docker build -t assistify/chat:$CIRCLE_TAG .
docker push assistify/chat:$CIRCLE_TAG
# # echo "Build preview Docker image"
# # cp ~/repo/.docker-mongo/Dockerfile .
# # cp ~/repo/.docker-mongo/entrypoint.sh .
# # docker build -t assistify/chat.preview:$CIRCLE_TAG .
# # docker push assistify/chat.preview:$CIRCLE_TAG
# if echo "$CIRCLE_TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]-[0-9]+\.[0-9]+\.[0-9]+$' ; then
# docker tag assistify/chat:$CIRCLE_TAG assistify/chat:latest
# docker push assistify/chat:latest
# docker tag assistify/chat.preview:$CIRCLE_TAG assistify/chat.preview:latest
# docker push assistify/chat.preview:latest
# elif echo "$CIRCLE_TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]-[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$' ; then
# docker tag assistify/chat:$CIRCLE_TAG assistify/chat:release-candidate
# docker push assistify/chat:release-candidate
# docker tag assistify/chat.preview:$CIRCLE_TAG assistify/chat.preview:release-candidate
# docker push assistify/chat.preview:release-candidate
# fi
exit 0
fi;
if [[ $CIRCLE_BRANCH == 'develop' ]]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
Expand Down

0 comments on commit cead1eb

Please sign in to comment.