Skip to content

Commit 23a34a2

Browse files
authored
fix(script): Download jmx_exporter jar and sha256 sum file from github (#986)
The old location doesn't have the new Jar.
1 parent a4a8953 commit 23a34a2

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.scripts/upload_new_jmx_exporter_version.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,20 @@ trap cleanup EXIT
3131

3232
cd "$WORK_DIR" || exit
3333

34-
# JMX Exporter does not currently publish signatures or SBOMs (as of 2023-07-24, latest version at this point 0.19.0)
34+
JAR_FILE="jmx_prometheus_javaagent-$VERSION.jar"
35+
SUM_FILE="$JAR_FILE.sha256"
36+
3537
echo "Downloading JMX Exporter"
36-
curl --fail -LOs "https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/$VERSION/jmx_prometheus_javaagent-$VERSION.jar"
38+
curl --fail -LOs "https://github.com/prometheus/jmx_exporter/releases/download/$VERSION/$JAR_FILE"
39+
curl --fail -LOs "https://github.com/prometheus/jmx_exporter/releases/download/$VERSION/$SUM_FILE"
40+
41+
# Check that sha256 sum matches before uploading
42+
sha256sum --check --status "$SUM_FILE" && echo "SHA256 Sum matches"
3743

3844
echo "Uploading to Nexus"
39-
curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "jmx_prometheus_javaagent-$VERSION.jar" 'https://repo.stackable.tech/repository/packages/jmx-exporter/'
45+
curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "$JAR_FILE" 'https://repo.stackable.tech/repository/packages/jmx-exporter/'
46+
curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "$SUM_FILE" 'https://repo.stackable.tech/repository/packages/jmx-exporter/'
4047

41-
echo "Successfully uploaded new version of JMX Exporter ($VERSION) to Nexus"
48+
echo "Successfully uploaded new version of the JMX Exporter ($VERSION) Jar to Nexus"
4249
echo "https://repo.stackable.tech/service/rest/repository/browse/packages/jmx-exporter/"
43-
echo "https://github.com/prometheus/jmx_exporter/releases/tag/parent-$VERSION"
50+
echo "https://github.com/prometheus/jmx_exporter/releases/tag/$VERSION"

0 commit comments

Comments
 (0)