Skip to content

Commit

Permalink
cleanup docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Jul 23, 2024
1 parent 243d2b9 commit fc3c078
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 23 deletions.
49 changes: 27 additions & 22 deletions .github/actions/publish-docker-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,27 @@ inputs:
docker_tag:
required: false
description: 'additional docker tags'
do_push:
required: false
default: 'false'
description: 'whether or not to actually push the image'

runs:
using: "composite"
steps:
- uses: actions/checkout@v4

- name: Download OpenTelemetry
shell: bash
run: |-
# "jq -r" removes the quotation marks, that would trip up "wget"
URL=$(grep "val openTelemetryAgentUrl = " build.gradle.kts | awk -F'= ' '{print $2}' | jq -r)
wget -O ${{ inputs.rootDir }}/opentelemetry-javaagent.jar -q $URL
#####################
# Login to DockerHub
#####################
- name: DockerHub login
uses: docker/login-action@v2
with:
username: ${{ inputs.docker_user }}
password: ${{ inputs.docker_token }}
#
# - name: Download OpenTelemetry
# shell: bash
# run: |-
# # "jq -r" removes the quotation marks, that would trip up "wget"
# URL=$(grep "val openTelemetryAgentUrl = " build.gradle.kts | awk -F'= ' '{print $2}' | jq -r)
# wget -O ${{ inputs.rootDir }}/opentelemetry-javaagent.jar -q $URL
#
# #####################
# # Login to DockerHub
# #####################
# - name: DockerHub login
# uses: docker/login-action@v2
# with:
# username: ${{ inputs.docker_user }}
# password: ${{ inputs.docker_token }}

#####################
# Build JAR file
Expand All @@ -74,7 +71,8 @@ runs:
- name: Build Controlplane
shell: bash
run: |-
./gradlew -p ${{ inputs.rootDir }} shadowJar
# ./gradlew -p ${{ inputs.rootDir }} dockerize
echo "test"

###############################
# Set metadata of docker image
Expand All @@ -95,6 +93,13 @@ runs:
type=raw,value=latest,enable={{is_default_branch}}
type=sha
- shell: bash
run: |
echo "TAGS:"
echo ${{ steps.meta.outputs.tags }}
echo "LABELS:"
echo ${{ steps.meta.outputs.labels }}
###############################
# Build and push the image
###############################
Expand All @@ -106,7 +111,7 @@ runs:
build-args: |
JAR=${{ inputs.rootDir }}/build/libs/${{ inputs.imagename }}.jar
OTEL_JAR=${{ inputs.rootDir }}/opentelemetry-javaagent.jar
push: ${{ inputs.do_push == 'true' }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/publish-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ jobs:
imagename: ${{ matrix.variant.img }}
docker_user: ${{ secrets.DOCKER_HUB_USER }}
docker_token: ${{ secrets.DOCKER_HUB_TOKEN }}
do_push: 'true'

# Release: Helm Charts
helm-release:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/test-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: test docker

on:
push:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Export RELEASE_VERSION env
run: |
echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV
- uses: ./.github/actions/publish-docker-image
name: Publish ${{ matrix.variant.img }}
with:
docker_tag: ${{ env.RELEASE_VERSION }}
rootDir: edc-controlplane/edc-runtime-memory
imagename: edc-runtime-memory
docker_user: any
docker_token: any

0 comments on commit fc3c078

Please sign in to comment.