Skip to content

Commit

Permalink
Add maven to registry auto update workflow (open-telemetry#5586)
Browse files Browse the repository at this point in the history
Signed-off-by: svrnm <[email protected]>
Co-authored-by: opentelemetrybot <[email protected]>
  • Loading branch information
svrnm and opentelemetrybot authored Nov 18, 2024
1 parent b20a22d commit 4cd7d59
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/scripts/update-registry-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
UPDATE_YAML="yq eval -i"
GIT=git
GH=gh
NPM=npm
FILES="${FILES:-./data/registry/*.yml}"


Expand All @@ -16,6 +17,7 @@ elif [[ "$1" != "-f" ]]; then
UPDATE_YAML="yq eval"
GIT="echo > DRY RUN: git "
GH="echo > DRY RUN: gh "
NPM="echo > DRY RUN: npm "
else
# Local execution with -f flag (force real vs. dry run)
shift
Expand Down Expand Up @@ -59,6 +61,12 @@ for yaml_file in ${FILES}; do
hex)
curl -s "https://hex.pm/api/packages/$package_name" | jq -r '.releases | max_by(.inserted_at) | .version'
;;
maven)
groupid=$(echo "${package_name}" | cut -d/ -f1)
artifactid=$(echo "${package_name}" | cut -d/ -f2)
#curl -s "https://search.maven.org/solrsearch/select?q=g:com.google.inject+AND+a:guice&core=gav&rows=20&wt=json" | jq -r '.response.docs[0].v'
curl -s "https://search.maven.org/solrsearch/select?q=g:${groupid}+AND+a:${artifactid}&core=gav&rows=20&wt=json" | jq -r '.response.docs[0].v'
;;
*)
echo "Registry not supported."
;;
Expand Down Expand Up @@ -110,6 +118,8 @@ if [ "$existing_pr_count" -gt 0 ]; then
exit 0
fi

$NPM run fix:format

$GIT checkout -b "$branch"
$GIT commit -a -m "$message"
$GIT push --set-upstream origin "$branch"
Expand Down
3 changes: 3 additions & 0 deletions data/registry/instrumentation-java-finatra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ urls:
repo: https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/finatra-2.9
createdAt: 2020-11-05
isFirstParty: false
package:
registry: maven
name: io.opentelemetry.javaagent.instrumentation/opentelemetry-javaagent-finatra-2.9

0 comments on commit 4cd7d59

Please sign in to comment.