|
7 | 7 |
|
8 | 8 | stages:
|
9 | 9 | - build
|
10 |
| - - shared-pipeline |
11 | 10 | - publish
|
| 11 | + - shared-pipeline |
12 | 12 | - benchmarks
|
13 | 13 | - macrobenchmarks
|
14 | 14 | - tests
|
@@ -880,6 +880,87 @@ requirements_json_test:
|
880 | 880 | package-oci:
|
881 | 881 | needs: [ build ]
|
882 | 882 |
|
| 883 | +override_verify_maven_central: |
| 884 | + image: registry.ddbuild.io/images/base/gbi-ubuntu_2204:release |
| 885 | + stage: publish |
| 886 | + needs: [ ] |
| 887 | + rules: |
| 888 | + - if: '$POPULATE_CACHE' |
| 889 | + when: never |
| 890 | + - when: manual |
| 891 | + allow_failure: true |
| 892 | + script: |
| 893 | + - touch OVERRIDE_MAVEN_VERIFY |
| 894 | + cache: # Cache is used to signal between the override_verify_maven_central and verify_maven_central_deployment jobs |
| 895 | + - key: $CI_PIPELINE_ID-OVERRIDE_SIGNAL |
| 896 | + paths: |
| 897 | + - OVERRIDE_MAVEN_VERIFY |
| 898 | + policy: push |
| 899 | + unprotect: true |
| 900 | + |
| 901 | +# Verify Maven Central deployment is publicly available before publishing OCI images |
| 902 | +verify_maven_central_deployment: |
| 903 | + image: registry.ddbuild.io/images/base/gbi-ubuntu_2204:release |
| 904 | + stage: publish |
| 905 | + needs: [ deploy_to_maven_central ] |
| 906 | + rules: |
| 907 | + - if: '$POPULATE_CACHE' |
| 908 | + when: never |
| 909 | + - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' |
| 910 | + when: on_success |
| 911 | + - when: manual |
| 912 | + allow_failure: true |
| 913 | + cache: # Cache is used to signal between the override_verify_maven_central and verify_maven_central_deployment jobs |
| 914 | + - key: $CI_PIPELINE_ID-OVERRIDE_SIGNAL |
| 915 | + paths: |
| 916 | + - OVERRIDE_MAVEN_VERIFY |
| 917 | + policy: pull |
| 918 | + unprotect: true |
| 919 | + script: |
| 920 | + - if [ -f OVERRIDE_MAVEN_VERIFY ]; then echo "SKIPPING MAVEN VERIFICATION"; exit 0; fi |
| 921 | + - | |
| 922 | + export VERSION=${CI_COMMIT_TAG##v} |
| 923 | + ARTIFACT_URLS=( |
| 924 | + "https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" |
| 925 | + "https://repo1.maven.org/maven2/com/datadoghq/dd-trace-api/${VERSION}/dd-trace-api-${VERSION}.jar" |
| 926 | + "https://repo1.maven.org/maven2/com/datadoghq/dd-trace-ot/${VERSION}/dd-trace-ot-${VERSION}.jar" |
| 927 | + ) |
| 928 | + # Wait 5 mins initially, then try 5 times with a minute delay between each retry to see if the release artifacts are available |
| 929 | + sleep 300 |
| 930 | + TRY=0 |
| 931 | + MAX_TRIES=5 |
| 932 | + DELAY=60 |
| 933 | + while [ $TRY -lt $MAX_TRIES ]; do |
| 934 | + ARTIFACTS_AVAILABLE=true |
| 935 | + for URL in "${ARTIFACT_URLS[@]}"; do |
| 936 | + if ! curl --location --fail --silent --show-error -I "$URL"; then |
| 937 | + ARTIFACTS_AVAILABLE=false |
| 938 | + break |
| 939 | + fi |
| 940 | + done |
| 941 | + if [ "$ARTIFACTS_AVAILABLE" = true ]; then |
| 942 | + break |
| 943 | + fi |
| 944 | + TRY=$((TRY + 1)) |
| 945 | + if [ $TRY -eq $MAX_TRIES ]; then |
| 946 | + echo "The release was not available after 10 mins. Manually re-run the job to try again." |
| 947 | + exit 1 |
| 948 | + fi |
| 949 | + sleep $DELAY |
| 950 | + done |
| 951 | +
|
| 952 | +publishing-gate: |
| 953 | + needs: |
| 954 | + - job: verify_maven_central_deployment |
| 955 | + optional: true |
| 956 | + rules: |
| 957 | + - if: '$POPULATE_CACHE' |
| 958 | + when: never |
| 959 | + - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' |
| 960 | + when: on_success |
| 961 | + - when: manual |
| 962 | + allow_failure: true |
| 963 | + |
883 | 964 | configure_system_tests:
|
884 | 965 | variables:
|
885 | 966 | SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,simple_onboarding_appsec,docker-ssi,lib-injection"
|
|
0 commit comments