Skip to content

Commit

Permalink
Merge pull request #31 from danipaniii/update-docker-job
Browse files Browse the repository at this point in the history
Closes #30 GithubActions - Update docker job
  • Loading branch information
Heiko Holz committed Feb 10, 2023
2 parents 98172f1 + d76fcf5 commit 73f5025
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 37 deletions.
48 changes: 12 additions & 36 deletions .github/workflows/eumserver_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ jobs:
run: |
cd ./artifacts
sha256sum * >> inspectit-ocelot-eum-server-sha256-checksums.txt
# Uploading eumserver jar, for creating docker image in the next step
- name: Upload eumserver jar
uses: actions/upload-artifact@v3
with:
name: eumserver-jar
path: artifacts/inspectit-ocelot-eum-server-${{ github.ref_name }}.jar
- name: "Build Changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v3.5.0
Expand All @@ -56,38 +50,20 @@ jobs:
token: ${{ github.token }}
name: Version ${{ github.ref_name }}

publish_docker_image:
name: "Publish docker image"
build_and_publish_docker_images:
name: "Build and Push Docker Images"
runs-on: ubuntu-latest
needs: [build_and_release]
needs: build_and_release
environment: release
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download eumserver jar
uses: actions/download-artifact@v3
with:
name: eumserver-jar # with the name we are referencing the eumserver-jar uploaded in the build_and_release job
path: docker/
- name: Check if jar exists and rename it
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Docker Images
run: ./gradlew dockerTag -PbuildVersion=${{ github.ref_name }}
- name: Push Docker Images
run: |
cd docker
mv inspectit-ocelot-eum-server-${{ github.ref_name }}.jar inspectit-ocelot-eum-server.jar
ls
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: inspectit/inspectit-ocelot-eum-server:${{ github.ref_name }}, inspectit/inspectit-ocelot-eum-server:latest
file: ./docker/Dockerfile
docker login -u ${{ secrets.DOCKER_HUB_USER }} -p ${{ secrets.DOCKER_HUB_PASSWORD }}
docker push inspectit/inspectit-ocelot-eum-server:${{ github.ref_name }}
docker push inspectit/inspectit-ocelot-eum-server:latest
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ FROM openjdk:11-jre-slim
# =====
# In order to build a docker image locally, the eum-server should be build locally and the resulting jar should be renamed
# to 'inspectit-ocelot-eum-server.jar' and copied to the ./docker directory
ADD ./docker/ /
ADD ./ /
ENTRYPOINT ["sh", "/entrypoint.sh"]

0 comments on commit 73f5025

Please sign in to comment.