Skip to content

Commit

Permalink
fix: Remove certificate setup and add script to download agent
Browse files Browse the repository at this point in the history
  • Loading branch information
David Pequegnot committed Jun 25, 2024
1 parent fb4edd6 commit a47fb0f
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 49 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,4 @@ logs/*.gz
### Custom user certificates ###
docker/ca-trust/*


LOG_FILE_IS_UNDEFINED*

LOG_FILE_IS_UNDEFINED*
6 changes: 3 additions & 3 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ vscode:
- "[email protected]"

tasks:
# Download the Grafana OpenTelemetry Java agent and saves it in the instrumentation directory
- name: Download Grafana OpenTelemetry Java agent
before: mkdir -p instrumentation
command: curl -L https://github.com/grafana/grafana-opentelemetry-java/releases/download/v2.4.0-beta.1/grafana-opentelemetry-java.jar -o instrumentation/grafana-opentelemetry-java.jar
command: sh scripts/download-agent.sh
- name: Execute a first gradle task
command: ./gradlew tasks
- name: Build and start all the infrastructure
command: docker compose up -d --build
12 changes: 1 addition & 11 deletions api-gateway/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
FROM eclipse-temurin:21-jdk-alpine as build

ENV USE_SYSTEM_CA_CERTS=1

# INSTALL CA Certificates (useful for companies with SSL inspection)
ADD --chmod=644 docker/ca-trust/* /certificates/
RUN export USE_SYSTEM_CA_CERTS=1 && /__cacert_entrypoint.sh

WORKDIR /workspace/app

ENV SERVICE=api-gateway
Expand All @@ -16,15 +10,11 @@ COPY gradle gradle
COPY gradlew .
COPY settings.gradle.kts .

RUN --mount=type=cache,target=/root/.gradle /__cacert_entrypoint.sh ./gradlew :${SERVICE}:clean :${SERVICE}:build -x test
RUN --mount=type=cache,target=/root/.gradle ./gradlew :${SERVICE}:clean :${SERVICE}:build -x test --info
RUN mkdir -p ${SERVICE}/build/dependency && (cd ${SERVICE}/build/dependency && jar -xf ../libs/*-SNAPSHOT.jar)

FROM eclipse-temurin:21-jre-alpine

# INSTALL CA Certificates (useful for companies with SSL inspection)
ADD --chmod=644 docker/ca-trust/* /certificates/
RUN export USE_SYSTEM_CA_CERTS=1 && /__cacert_entrypoint.sh

ENV SERVICE=api-gateway
ENV LOGS_DIRECTORY=/logs/

Expand Down
8 changes: 0 additions & 8 deletions config-server/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
FROM eclipse-temurin:21-jdk-alpine as build

# INSTALL CA Certificates (useful for companies with SSL inspection)
ADD --chmod=644 docker/ca-trust/* /certificates/
RUN export USE_SYSTEM_CA_CERTS=1 && /__cacert_entrypoint.sh

WORKDIR /workspace/app

ENV SERVICE=config-server
Expand All @@ -19,10 +15,6 @@ RUN mkdir -p ${SERVICE}/build/dependency && (cd ${SERVICE}/build/dependency && j

FROM eclipse-temurin:21-jre-alpine

# INSTALL CA Certificates (useful for companies with SSL inspection)
ADD --chmod=644 docker/ca-trust/* /certificates/
RUN export USE_SYSTEM_CA_CERTS=1 && /__cacert_entrypoint.sh

ENV SERVICE=config-server
ENV LOGS_DIRECTORY=/logs/

Expand Down
8 changes: 0 additions & 8 deletions discovery-server/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
FROM eclipse-temurin:21-jdk-alpine as build

# INSTALL CA Certificates (useful for companies with SSL inspection)
ADD --chmod=644 docker/ca-trust/* /certificates/
RUN export USE_SYSTEM_CA_CERTS=1 && /__cacert_entrypoint.sh

WORKDIR /workspace/app

ENV SERVICE=discovery-server
Expand All @@ -19,10 +15,6 @@ RUN mkdir -p ${SERVICE}/build/dependency && (cd ${SERVICE}/build/dependency && j

FROM eclipse-temurin:21-jre-alpine

# INSTALL CA Certificates (useful for companies with SSL inspection)
ADD --chmod=644 docker/ca-trust/* /certificates/
RUN export USE_SYSTEM_CA_CERTS=1 && /__cacert_entrypoint.sh

ENV SERVICE=discovery-server
ENV LOGS_DIRECTORY=/logs/

Expand Down
8 changes: 0 additions & 8 deletions fraudetect-service/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
FROM eclipse-temurin:21-jdk-alpine as build

# INSTALL CA Certificates (useful for companies with SSL inspection)
ADD --chmod=644 docker/ca-trust/* /certificates/
RUN export USE_SYSTEM_CA_CERTS=1 && /__cacert_entrypoint.sh

WORKDIR /workspace/app

ENV SERVICE=fraudetect-service
Expand All @@ -19,10 +15,6 @@ RUN mkdir -p ${SERVICE}/build/dependency && (cd ${SERVICE}/build/dependency && j

FROM eclipse-temurin:21-jre-alpine

# INSTALL CA Certificates (useful for companies with SSL inspection)
ADD --chmod=644 docker/ca-trust/* /certificates/
RUN export USE_SYSTEM_CA_CERTS=1 && /__cacert_entrypoint.sh

ENV SERVICE=fraudetect-service
ENV LOGS_DIRECTORY=/logs/

Expand Down
8 changes: 0 additions & 8 deletions merchant-backoffice/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
FROM eclipse-temurin:21-jdk-alpine as build

# INSTALL CA Certificates (useful for companies with SSL inspection)
ADD --chmod=644 docker/ca-trust/* /certificates/
RUN export USE_SYSTEM_CA_CERTS=1 && /__cacert_entrypoint.sh

WORKDIR /workspace/app

ENV SERVICE=merchant-backoffice
Expand All @@ -19,10 +15,6 @@ RUN mkdir -p ${SERVICE}/build/dependency && (cd ${SERVICE}/build/dependency && j

FROM eclipse-temurin:21-jre-alpine

# INSTALL CA Certificates (useful for companies with SSL inspection)
ADD --chmod=644 docker/ca-trust/* /certificates/
RUN export USE_SYSTEM_CA_CERTS=1 && /__cacert_entrypoint.sh

ENV SERVICE=merchant-backoffice
ENV LOGS_DIRECTORY=/logs/

Expand Down
20 changes: 20 additions & 0 deletions scripts/download-agent.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

VERSION=v2.4.0-beta.1

# Define the URL of the Grafana OpenTelemetry agent
AGENT_URL="https://github.com/grafana/grafana-opentelemetry-java/releases/download/${VERSION}/grafana-opentelemetry-java.jar"

# Define the path to the instrumentation directory
#INSTRUMENTATION_DIR="$(dirname "$(dirname "${BASH_SOURCE[0]}")")/instrumentation"

INSTRUMENTATION_DIR="$(dirname "${BASH_SOURCE[0]}")/../instrumentation"

# Create the instrumentation directory if it doesn't exist
mkdir -p "$INSTRUMENTATION_DIR"

# Download the Grafana OpenTelemetry agent and save it in the instrumentation directory
curl -L "$AGENT_URL" -o "$INSTRUMENTATION_DIR/grafana-opentelemetry-java.jar"

# Print a success message
echo "Grafana OpenTelemetry agent downloaded successfully in $INSTRUMENTATION_DIR"

0 comments on commit a47fb0f

Please sign in to comment.