-
Notifications
You must be signed in to change notification settings - Fork 311
Add dependency on Maven Central deployment to OCI publish jobs #9204
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
base: master
Are you sure you want to change the base?
Changes from all commits
92750c5
1b1e50f
e517ca3
cf25cce
54a68b3
14b13bc
fa4d9b9
deff52d
707e5f1
9e3f0ae
dfd4777
7cf08ea
1b2c0e2
9df1556
b1e0a9a
4f1db26
cb9709f
f012fea
fe7374c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,8 @@ include: | |
|
||
stages: | ||
- build | ||
- shared-pipeline | ||
- publish | ||
- shared-pipeline | ||
- benchmarks | ||
- macrobenchmarks | ||
- tests | ||
|
@@ -880,6 +880,62 @@ requirements_json_test: | |
package-oci: | ||
needs: [ build ] | ||
|
||
# Verify Maven Central deployment is publicly available before publishing OCI images | ||
verify_maven_central_deployment: | ||
image: registry.ddbuild.io/images/base/gbi-ubuntu_2204:release | ||
stage: publish | ||
needs: [ deploy_to_maven_central ] | ||
rules: | ||
- if: '$POPULATE_CACHE' | ||
when: never | ||
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' | ||
when: on_success | ||
- when: manual | ||
allow_failure: true | ||
script: | ||
- | | ||
export VERSION=${CI_COMMIT_TAG##v} | ||
ARTIFACT_URLS=( | ||
"https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" | ||
"https://repo1.maven.org/maven2/com/datadoghq/dd-trace-api/${VERSION}/dd-trace-api-${VERSION}.jar" | ||
"https://repo1.maven.org/maven2/com/datadoghq/dd-trace-ot/${VERSION}/dd-trace-ot-${VERSION}.jar" | ||
) | ||
# Wait 5 mins initially, then try 5 times with a minute delay between each retry to see if the release artifacts are available | ||
sleep 300 | ||
TRY=0 | ||
MAX_TRIES=5 | ||
DELAY=60 | ||
while [ $TRY -lt $MAX_TRIES ]; do | ||
ARTIFACTS_AVAILABLE=true | ||
for URL in "${ARTIFACT_URLS[@]}"; do | ||
if ! curl --location --fail --silent --show-error -I "$URL"; then | ||
ARTIFACTS_AVAILABLE=false | ||
break | ||
fi | ||
done | ||
if [ "$ARTIFACTS_AVAILABLE" = true ]; then | ||
break | ||
fi | ||
TRY=$((TRY + 1)) | ||
if [ $TRY -eq $MAX_TRIES ]; then | ||
echo "The release was not available after 10 mins. Manually re-run the job to try again." | ||
exit 1 | ||
fi | ||
sleep $DELAY | ||
done | ||
|
||
publishing-gate: | ||
needs: | ||
- job: verify_maven_central_deployment | ||
optional: true | ||
rules: | ||
- if: '$POPULATE_CACHE' | ||
when: never | ||
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' | ||
when: on_success | ||
- when: manual | ||
allow_failure: true | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this doesn't work as you expect. If There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried testing this by running a It seems like even if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just kidding -- you can see here in @randomanderson 's reproduction (pipeline, code) that if |
||
configure_system_tests: | ||
variables: | ||
SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,simple_onboarding_appsec,docker-ssi,lib-injection" | ||
|
Uh oh!
There was an error while loading. Please reload this page.