feature: Push also tagged images
@@ -72,17 +72,12 @@ jobs:
curl -fsSL https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz | tar xz -C /usr/bin --strip-components 1
if [ "${CIRCLE_BRANCH}" == "master" ]; then
- DOCKER_IMAGE_TAG="latest"
- elif [[ "${CIRCLE_BRANCH}" =~ ^summit-demo ]]; then
- DOCKER_IMAGE_TAG="${CIRCLE_BRANCH}"
- docker tag syndesis/syndesis-rest:latest syndesis/syndesis-rest:${DOCKER_IMAGE_TAG}
- elif [[ "${CIRCLE_TAG}" =~ ^v[0-9]+(\.[0-9]+){2} ]]; then
- DOCKER_IMAGE_TAG="${CIRCLE_TAG}"
- fi
-
- if [ -z "${DOCKER_IMAGE_TAG}" ]; then
- exit 0
+ docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
+ docker push syndesis/syndesis-rest:latest | cat -
fi
-
+ if [[ "${CIRCLE_TAG}" =~ ^[0-9]+(\.[0-9]+){2} ]]; then
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker push syndesis/syndesis-rest:${DOCKER_IMAGE_TAG} | cat -
+ docker push syndesis/syndesis-rest:${CIRCLE_TAG} | cat -
+ docker tag syndesis/syndesis-rest:${CIRCLE_TAG} syndesis/syndesis-rest:$(echo ${CIRCLE_TAG} | sed -e 's/\.[0-9][0-9]*$//')
+ docker push syndesis/syndesis-rest:$(echo ${CIRCLE_TAG} | sed -e 's/\.[0-9][0-9]*$//')
+ fi
