diff --git a/.env b/.env index 9fd97857b7..6953867ed4 100644 --- a/.env +++ b/.env @@ -18,6 +18,9 @@ VALKEY_IMAGE=valkey/valkey:8.0-alpine # must also update the version arg in ./test/tracetesting/Dockerfile TRACETEST_IMAGE=kubeshop/tracetest:v1.5.2 +# Build Args +OTEL_JAVA_AGENT_VERSION=2.9.0 + # Demo Platform ENV_PLATFORM=local diff --git a/.github/workflows/component-build-images.yml b/.github/workflows/component-build-images.yml index d209aeb29b..8bfba4e29e 100644 --- a/.github/workflows/component-build-images.yml +++ b/.github/workflows/component-build-images.yml @@ -124,6 +124,15 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Load .env variables + if: ${{ inputs.push }} + run: | + set -a + source <(grep -vE '^\s*#|^\s*$' .env) + set +a + for var in $(cat .env | cut -d= -f1); do + echo "$var=${!var}" >> $GITHUB_ENV + done - name: Check for changes and set push options id: check_changes run: | diff --git a/src/adservice/Dockerfile b/src/adservice/Dockerfile index 97c2ebd1ed..369af01a05 100644 --- a/src/adservice/Dockerfile +++ b/src/adservice/Dockerfile @@ -20,11 +20,11 @@ RUN ./gradlew installDist -PprotoSourceDir=./proto FROM eclipse-temurin:21-jre -ARG version=2.6.0 +ARG OTEL_JAVA_AGENT_VERSION WORKDIR /usr/src/app/ COPY --from=builder /usr/src/app/ ./ -ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$version/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar +ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$OTEL_JAVA_AGENT_VERSION/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar EXPOSE ${AD_SERVICE_PORT} diff --git a/src/frauddetectionservice/Dockerfile b/src/frauddetectionservice/Dockerfile index c7e17158b3..f3f62401da 100644 --- a/src/frauddetectionservice/Dockerfile +++ b/src/frauddetectionservice/Dockerfile @@ -14,11 +14,11 @@ RUN gradle shadowJar FROM gcr.io/distroless/java17-debian11 -ARG version=2.4.0 +ARG OTEL_JAVA_AGENT_VERSION WORKDIR /usr/src/app/ COPY --from=builder /usr/src/app/build/libs/frauddetectionservice-1.0-all.jar ./ -ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$version/opentelemetry-javaagent.jar /app/opentelemetry-javaagent.jar +ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$OTEL_JAVA_AGENT_VERSION/opentelemetry-javaagent.jar /app/opentelemetry-javaagent.jar ENV JAVA_TOOL_OPTIONS=-javaagent:/app/opentelemetry-javaagent.jar ENTRYPOINT [ "java", "-jar", "frauddetectionservice-1.0-all.jar" ] diff --git a/src/kafka/Dockerfile b/src/kafka/Dockerfile index b3e6a236b5..42e4ffd139 100644 --- a/src/kafka/Dockerfile +++ b/src/kafka/Dockerfile @@ -5,11 +5,11 @@ FROM apache/kafka:3.7.0 USER root -ARG version=2.4.0 +ARG OTEL_JAVA_AGENT_VERSION USER appuser -ADD --chown=appuser:appuser https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$version/opentelemetry-javaagent.jar /tmp/opentelemetry-javaagent.jar +ADD --chown=appuser:appuser https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$OTEL_JAVA_AGENT_VERSION/opentelemetry-javaagent.jar /tmp/opentelemetry-javaagent.jar ENV KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093 ENV KAFKA_CONTROLLER_QUORUM_VOTERS='1@0.0.0.0:9093'