Browse Source

Merge pull request #1160 from pelias/build-greenkeeper-branches

Build Docker images on Greenkeeper branches
pull/1162/head
Julian Simioni 7 years ago committed by GitHub
parent
commit
b16dbea396
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      .circleci/docker.sh

7
.circleci/docker.sh

@ -6,17 +6,12 @@ DATE=`date +%Y-%m-%d`
DOCKER_REPOSITORY="pelias" DOCKER_REPOSITORY="pelias"
DOCKER_PROJECT="${DOCKER_REPOSITORY}/${CIRCLE_PROJECT_REPONAME}" DOCKER_PROJECT="${DOCKER_REPOSITORY}/${CIRCLE_PROJECT_REPONAME}"
# skip builds on greenkeeper branches
if [[ -z "${CIRCLE_BRANCH##*greenkeeper*}" ]]; then
exit 0
fi
# the name of the image that represents the "branch", that is an image that will be updated over time with the git branch # the name of the image that represents the "branch", that is an image that will be updated over time with the git branch
# the production branch is changed to "latest", otherwise the git branch becomes the name of the version # the production branch is changed to "latest", otherwise the git branch becomes the name of the version
if [[ "${CIRCLE_BRANCH}" == "production" ]]; then if [[ "${CIRCLE_BRANCH}" == "production" ]]; then
DOCKER_BRANCH_IMAGE_VERSION="latest" DOCKER_BRANCH_IMAGE_VERSION="latest"
else else
DOCKER_BRANCH_IMAGE_VERSION="${CIRCLE_BRANCH}" DOCKER_BRANCH_IMAGE_VERSION="${CIRCLE_BRANCH/\//-}" #slashes are not valid in docker tags. replace with dashes
fi fi
DOCKER_BRANCH_IMAGE_NAME="${DOCKER_PROJECT}:${DOCKER_BRANCH_IMAGE_VERSION}" DOCKER_BRANCH_IMAGE_NAME="${DOCKER_PROJECT}:${DOCKER_BRANCH_IMAGE_VERSION}"

Loading…
Cancel
Save