diff --git a/.circleci/docker-image-build.sh b/.circleci/docker-image-build.sh index b744ad6ff..3ecb64a33 100755 --- a/.circleci/docker-image-build.sh +++ b/.circleci/docker-image-build.sh @@ -6,16 +6,20 @@ set -o errexit set -o pipefail REPO_ROOT="$(git rev-parse --show-toplevel)" -REPO_USER="zammad" +GITHUB_REPO_USER="zammad" ZAMMAD_VERSION="$(git describe --tags | sed -e 's/-[a-z0-9]\{8,\}.*//g')" export ZAMMAD_VERSION if [ "${CIRCLE_BRANCH}" == 'develop' ]; then - DOCKER_REPOSITORY="zammad-docker" BUILD_SCRIPT="scripts/build_image.sh" + DOCKER_REPOSITORY="zammad" + export DOCKER_REPOSITORY + GITHUB_REPOSITORY="zammad-docker" elif [ "${CIRCLE_BRANCH}" == 'stable' ]; then - DOCKER_REPOSITORY="zammad-docker-compose" BUILD_SCRIPT="hooks/build.sh" + DOCKER_REPOSITORY="zammad-docker-compose" + export DOCKER_REPOSITORY + GITHUB_REPOSITORY="zammad-docker-compose" else echo "branch is ${CIRCLE_BRANCH}... no docker image build needed..." exit 0 @@ -25,11 +29,11 @@ fi echo "${DOCKER_PASSWORD}" | docker login --username="${DOCKER_USERNAME}" --password-stdin # clone docker repo -git clone https://github.com/"${REPO_USER}"/"${DOCKER_REPOSITORY}" +git clone https://github.com/"${GITHUB_REPO_USER}"/"${GITHUB_REPOSITORY}" # enter dockerfile dir -cd "${REPO_ROOT}/${DOCKER_REPOSITORY}" +cd "${REPO_ROOT}/${GITHUB_REPOSITORY}" # build & push docker image # shellcheck disable=SC1090 -source "${REPO_ROOT}/${DOCKER_REPOSITORY}/${BUILD_SCRIPT}" +source "${REPO_ROOT}/${GITHUB_REPOSITORY}/${BUILD_SCRIPT}"