fixed docker repo

Signed-off-by: André Bauer <andre.bauer@kiwigrid.com>
This commit is contained in:
André Bauer 2019-02-12 12:39:03 +01:00
parent de15ce2cdf
commit 413d8eb03b

View file

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