Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto update .net instrumentation #163

Merged
merged 2 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions .github/workflows/update-otel-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,27 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch latest version of OTel Java Instrumentation
- name: Fetch latest version of instrumentations
id: fetch_latest_version
run: |
latest_version=$(curl --silent "https://api.github.com/repos/open-telemetry/opentelemetry-java-instrumentation/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
echo "latest_version=${latest_version}" >> $GITHUB_OUTPUT
echo "Latest version of opentelemetry-java-instrumentation is ${latest_version}"
- name: Replace JAVA_OTEL_VERSION in Dockerfile
java_latest_version=$(curl --silent "https://api.github.com/repos/open-telemetry/opentelemetry-java-instrumentation/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
echo "java_latest_version=${java_latest_version}" >> $GITHUB_OUTPUT
dotnet_latest_version=$(curl --silent "https://api.github.com/repos/open-telemetry/opentelemetry-dotnet-instrumentation/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
echo "dotnet_latest_version=${dotnet_latest_version}" >> $GITHUB_OUTPUT
echo "Latest version of opentelemetry-java-instrumentation is ${java_latest_version}"
echo "Latest version of opentelemetry-dotnet-instrumentation is ${dotnet_latest_version}"
- name: Replace versions in Dockerfile
run: |
cd odiglet
latest_version=${{ steps.fetch_latest_version.outputs.latest_version }}
sed -i "s/JAVA_OTEL_VERSION=.*/JAVA_OTEL_VERSION=${latest_version}/" Dockerfile
java_latest_version=${{ steps.fetch_latest_version.outputs.java_latest_version }}
sed -i "s/JAVA_OTEL_VERSION=.*/JAVA_OTEL_VERSION=${java_latest_version}/" Dockerfile
dotnet_latest_version=${{ steps.fetch_latest_version.outputs.dotnet_latest_version }}
sed -i "s/DOTNET_OTEL_VERSION=.*/DOTNET_OTEL_VERSION=${dotnet_latest_version}/" Dockerfile
- name: Create pull request
uses: peter-evans/create-pull-request@v5
with:
commit-message: 'Update Java instrumentation to version ${{ steps.fetch_latest_version.outputs.latest_version }}'
commit-message: 'Update Java instrumentation to ${{ steps.fetch_latest_version.outputs.java_latest_version }} and .NET instrumentation to ${{ steps.fetch_latest_version.outputs.dotnet_latest_version }}'
branch: automated/update-opentelemetry-instrumentations
delete-branch: true
title: '[auto] Update Java instrumentation to version ${{ steps.fetch_latest_version.outputs.latest_version }}'
body: "This pull request updates the JAVA_OTEL_VERSION in the Dockerfile to the latest version of opentelemetry-java-instrumentation (${latest_version})."
title: '[auto] Update Java instrumentation to version ${{ steps.fetch_latest_version.outputs.java_latest_version }} and .NET instrumentation to version ${{ steps.fetch_latest_version.outputs.dotnet_latest_version }}'
body: "This pull request updates the Java instrumentation to version ${{ steps.fetch_latest_version.outputs.java_latest_version }} and the .NET instrumentation to version ${{ steps.fetch_latest_version.outputs.dotnet_latest_version }}. It was created automatically by a GitHub Action."
4 changes: 2 additions & 2 deletions odiglet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ RUN npm install

FROM busybox AS dotnet-builder
WORKDIR /dotnet-instrumentation
ARG DOTNET_OTEL_VERSION=0.5.0
ADD https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/download/v$DOTNET_OTEL_VERSION/opentelemetry-dotnet-instrumentation-linux-musl.zip .
ARG DOTNET_OTEL_VERSION=v0.5.0
ADD https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/download/$DOTNET_OTEL_VERSION/opentelemetry-dotnet-instrumentation-linux-musl.zip .
RUN unzip opentelemetry-dotnet-instrumentation-linux-musl.zip && rm opentelemetry-dotnet-instrumentation-linux-musl.zip

FROM golang:1.19 AS builder
Expand Down