Skip to content

Commit

Permalink
Added job to build docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKunz committed Feb 8, 2023
1 parent 8d61915 commit f2f66d5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions scripts/jenkins/push_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

0 comments on commit f2f66d5

Please sign in to comment.