diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 39dc0b3212c..59ae6297dfe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -91,3 +91,22 @@ jobs: shell: bash run: .ci/release/update_cloudfoundry.sh ${{ inputs.version }} - run: git push origin main + + + build_docker_images: + name: "Build and push docker images" + runs-on: ubuntu-latest + env: + TAG_NAME: v${{ inputs.version }} + SONATYPE_FALLBACK: 1 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Load entire history as it is required for the push-script + # TODO: docker login + - name: "Build docker image" + shell: bash + run: ./scripts/jenkins/build_docker.sh + - name: "Tag and push docker images" + shell: bash + run: ./scripts/jenkins/push_docker.sh diff --git a/scripts/jenkins/push_docker.sh b/scripts/jenkins/push_docker.sh index e6f26bd0ee2..2953639ce9d 100755 --- a/scripts/jenkins/push_docker.sh +++ b/scripts/jenkins/push_docker.sh @@ -48,7 +48,7 @@ if [ ${WORKERS+x} ] # We are on a CI worker then retry $RETRIES docker push $DOCKER_PUSH_IMAGE || echo "Push failed after $RETRIES retries" else # We are in a local (non-CI) environment - docker push $DOCKER_PUSH_IMAGE || echo "You may need to run 'docker login' first and then re-run this script" + docker push $DOCKER_PUSH_IMAGE || { echo "You may need to run 'docker login' first and then re-run this script"; exit 1; } fi readonly LATEST_TAG=$(git tag --list --sort=version:refname "v*" | grep -v RC | sed s/^v// | tail -n 1) @@ -62,6 +62,6 @@ then then retry $RETRIES docker push $DOCKER_PUSH_IMAGE_LATEST || echo "Push failed after $RETRIES retries" else # We are in a local (non-CI) environment - docker push $DOCKER_PUSH_IMAGE_LATEST || echo "You may need to run 'docker login' first and then re-run this script" + docker push $DOCKER_PUSH_IMAGE_LATEST || { echo "You may need to run 'docker login' first and then re-run this script"; exit 1; } fi fi