|
23 | 23 |
|
24 | 24 | # deletes the temp directory
|
25 | 25 | function cleanup {
|
26 |
| - rm -rf "$WORK_DIR" |
| 26 | + rm -rf "$WORK_DIR" |
27 | 27 | }
|
28 | 28 |
|
29 | 29 | # register the cleanup function to be called on the EXIT signal
|
30 | 30 | trap cleanup EXIT
|
31 | 31 |
|
32 | 32 | cd "$WORK_DIR" || exit
|
33 | 33 |
|
34 |
| -src_file=jmx_prometheus-$VERSION-src.tar.gz |
| 34 | +JAR_FILE="jmx_prometheus_javaagent-$VERSION.jar" |
| 35 | +SUM_FILE="$JAR_FILE.sha256" |
35 | 36 |
|
36 |
| -# JMX Exporter does not currently publish signatures or SBOMs (as of 2023-07-24, latest version at this point 0.19.0) |
37 | 37 | echo "Downloading JMX Exporter"
|
38 |
| -# JMX Exporter provides no offficial source tarballs, download from Git |
39 |
| -git clone https://github.com/prometheus/jmx_exporter "jmx_prometheus-${VERSION}" "--branch=${VERSION}" --depth=1 |
| 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 | 40 |
|
41 |
| -echo "Archiving JMX Exporter" |
42 |
| -git -C "jmx_prometheus-${VERSION}" archive "${VERSION}" --format=tar.gz --prefix="jmx_prometheus-${VERSION}-src/" > "${src_file}" |
43 |
| -sha256sum "${src_file}" | cut --delimiter=' ' --field=1 > "${src_file}.sha256" |
| 41 | +# Check that sha256 sum matches before uploading |
| 42 | +sha256sum --check --status "$SUM_FILE" && echo "SHA256 Sum matches" |
44 | 43 |
|
45 | 44 | echo "Uploading to Nexus"
|
46 |
| -curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "${src_file}" 'https://repo.stackable.tech/repository/packages/jmx-exporter/' |
47 |
| -curl --fail -u "$NEXUS_USER:$NEXUS_PASSWORD" --upload-file "${src_file}.sha256" '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/' |
48 | 47 |
|
49 |
| -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" |
50 | 49 | echo "https://repo.stackable.tech/service/rest/repository/browse/packages/jmx-exporter/"
|
51 |
| -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