Skip to content

Commit bec3def

Browse files
authored
Add artifact tracing on publish (#1364)
This commit adds papertrail tracing on release to all modules we release. This tracing will run on every snapshot and release. The change to publish.gradle was done because we need to ensure that the generated .pom, .md5, and .sha1 files are available on disk for tracing. We will now also "publish" these files to a location on disk that enables simple tracing in Papertrail. The filename patterns were chosen because the gradle publish command also includes non-release files with duplicate names that we do not want to trace. JAVA-5415
1 parent ee69466 commit bec3def

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.evergreen/.evg.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,40 @@ functions:
821821
822822
MONGODB_URI="${MONGODB_URI}" JAVA_VERSION="${JAVA_VERSION}" .evergreen/run-csfle-tests-with-mongocryptd.sh
823823
824+
"trace artifacts":
825+
- command: shell.exec
826+
params:
827+
working_dir: "src"
828+
script: |
829+
tag=$(git describe --tags --always --dirty)
830+
831+
# remove the leading 'r'
832+
version=$(echo -n "$tag" | cut -c 2-)
833+
834+
cat <<EOT > trace-expansions.yml
835+
release_version: "$version"
836+
EOT
837+
cat trace-expansions.yml
838+
- command: expansions.update
839+
params:
840+
file: src/trace-expansions.yml
841+
- command: papertrail.trace
842+
params:
843+
key_id: ${papertrail_key_id}
844+
secret_key: ${papertrail_secret_key}
845+
product: ${product}
846+
version: ${release_version}
847+
filenames:
848+
- "src/build/repo/org/mongodb/*/*/*.jar"
849+
- "src/build/repo/org/mongodb/*/*/*.pom"
850+
- "src/build/repo/org/mongodb/*/*/*.asc"
851+
- "src/build/repo/org/mongodb/*/*/*.jar.md5"
852+
- "src/build/repo/org/mongodb/*/*/*.pom.md5"
853+
- "src/build/repo/org/mongodb/*/*/*.asc.md5"
854+
- "src/build/repo/org/mongodb/*/*/*.jar.sha1"
855+
- "src/build/repo/org/mongodb/*/*/*.pom.sha1"
856+
- "src/build/repo/org/mongodb/*/*/*.asc.sha1"
857+
824858
"publish snapshot":
825859
- command: shell.exec
826860
type: test
@@ -1491,11 +1525,17 @@ tasks:
14911525
name: "static-analysis"
14921526
commands:
14931527
- func: "publish snapshot"
1528+
- func: "trace artifacts"
1529+
vars:
1530+
product: mongo-java-driver-snapshot
14941531

14951532
- name: publish-release
14961533
git_tag_only: true
14971534
commands:
14981535
- func: "publish release"
1536+
- func: "trace artifacts"
1537+
vars:
1538+
product: mongo-java-driver
14991539

15001540
- name: "perf"
15011541
tags: ["perf"]

gradle/publish.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ ext {
5555
password project.hasProperty('nexusPassword') ? project.getProperty('nexusPassword') : ''
5656
}
5757
}
58+
59+
maven {
60+
url = "$rootDir/build/repo"
61+
}
5862
}
5963
}
6064
configureJarManifestAttributes = { project ->

0 commit comments

Comments
 (0)