From 948d7f9a44241035c1c0fa66740130c684435904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Fri, 6 Mar 2020 15:13:28 +0100 Subject: [PATCH] github action test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Bauer --- .github/docker-image-build.sh | 13 ++++--------- .github/workflows/ci.yaml | 17 ++--------------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/.github/docker-image-build.sh b/.github/docker-image-build.sh index 50b1904..05fa802 100755 --- a/.github/docker-image-build.sh +++ b/.github/docker-image-build.sh @@ -7,17 +7,12 @@ set -o pipefail DOCKER_IMAGES="zammad zammad-elasticsearch zammad-postgresql" DOCKER_IMAGE_TAG="ci-snapshot" -DOCKER_REGISTRY="index.docker.io" -DOCKER_REPOSITORY="zammad-docker-compose" - -# dockerhub auth -echo "${DOCKER_PASSWORD}" | docker login --username="${DOCKER_USERNAME}" --password-stdin # shellcheck disable=SC2153 for DOCKER_IMAGE in ${DOCKER_IMAGES}; do - echo "Build Zammad Docker image ${DOCKER_IMAGE} with version ${DOCKER_IMAGE_TAG} for DockerHubs ${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY} repo" - - docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-${DOCKER_IMAGE_TAG}" -f "containers/${DOCKER_IMAGE}/Dockerfile" . - docker push "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-${DOCKER_IMAGE_TAG}" + echo "Build Zammad Docker image ${DOCKER_IMAGE} with version ${DOCKER_IMAGE_TAG} for local test" + docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${DOCKER_IMAGE}-${DOCKER_IMAGE_TAG}" -f "containers/${DOCKER_IMAGE}/Dockerfile" . done +# change images in compose file +sed -i -e 's#image: ${IMAGE_REPO}:##g' -e 's#${VERSION}#-ci-snapsoht#g'< docker-compose.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6f681f6..31b3956 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,21 +32,6 @@ jobs: with: dockerfile: containers/zammad-postgresql/Dockerfile - build-containers: - needs: - - lint-bash-scripts - - lint-docker-files - runs-on: ubuntu-latest - env: - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - REPO_USER: ${{ secrets.REPO_USER }} - steps: - - name: Checkout - uses: actions/checkout@v1 - - name: build docker containers - run: .github/docker-image-build.sh - test-docker-compose: needs: build-containers timeout-minutes: 10 @@ -54,6 +39,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v1 + - name: build docker containers + run: .github/docker-image-build.sh - name: use images build by ci run: sed -i -e 's#VERSION=.*#VERSION=-ci-snapshot#g' < .env - name: pull container images