|
9 | 9 | - build |
10 | 10 | - shared-pipeline |
11 | 11 | - publish |
12 | | - - publish-oci-images |
13 | 12 | - benchmarks |
14 | 13 | - macrobenchmarks |
15 | 14 | - tests |
@@ -142,6 +141,8 @@ default: |
142 | 141 | CACHE_COMPRESSION_LEVEL: "slowest" |
143 | 142 |
|
144 | 143 | RUNTIME_AVAILABLE_PROCESSORS_OVERRIDE: 4 # Runtime.getRuntime().availableProcessors() returns incorrect or very high values in Kubernetes |
| 144 | + GIT_SUBMODULE_STRATEGY: normal |
| 145 | + GIT_SUBMODULE_DEPTH: 1 |
145 | 146 | cache: |
146 | 147 | - key: dependency-$CACHE_TYPE # Dependencies cache |
147 | 148 | paths: |
@@ -192,6 +193,7 @@ default: |
192 | 193 | after_script: |
193 | 194 | - *cgroup_info |
194 | 195 |
|
| 196 | +# TODO: Add a pre-release check to see if the dd-octo-sts token is working. |
195 | 197 | # Checks and fail early if central credentials are incorrect, indeed, when a new token is generated |
196 | 198 | # on the central publisher protal, it invalidates the old one. This checks prevents going further. |
197 | 199 | # See https://datadoghq.atlassian.net/wiki/x/Oog5OgE |
@@ -803,14 +805,54 @@ deploy_to_maven_central: |
803 | 805 |
|
804 | 806 | deploy_artifacts_to_github: |
805 | 807 | stage: publish |
806 | | - image: registry.ddbuild.io/github-cli:v27480869-eafb11d-2.43.0 |
| 808 | + image: registry.ddbuild.io/images/dd-octo-sts-ci-base:2025.06-1 |
| 809 | + tags: [ "arch:amd64" ] |
| 810 | + id_tokens: |
| 811 | + DDOCTOSTS_ID_TOKEN: |
| 812 | + aud: dd-octo-sts |
807 | 813 | rules: |
808 | 814 | - if: '$POPULATE_CACHE' |
809 | 815 | when: never |
810 | 816 | - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' |
811 | 817 | when: on_success |
812 | 818 | # Requires the deploy_to_maven_central job to have run first (the UP-TO-DATE gradle check across jobs is broken) |
813 | 819 | # This will deploy the artifacts built from the publishToSonatype task to the GitHub release |
| 820 | + needs: |
| 821 | + - job: deploy_to_maven_central |
| 822 | + # The deploy_to_maven_central job is not run for release candidate versions |
| 823 | + optional: true |
| 824 | + before_script: |
| 825 | + # Get token |
| 826 | + - dd-octo-sts version |
| 827 | + - dd-octo-sts debug --scope DataDog/dd-trace-java --policy self.gitlab.release |
| 828 | + - dd-octo-sts token --scope DataDog/dd-trace-java --policy self.gitlab.release > github-token.txt |
| 829 | + script: |
| 830 | + - gh auth login --with-token < github-token.txt |
| 831 | + - gh auth status # Maybe helpful to have this output in logs? |
| 832 | + - export VERSION=${CI_COMMIT_TAG##v} # remove "v" from front of tag to get version |
| 833 | + - cp workspace/dd-java-agent/build/libs/dd-java-agent-${VERSION}.jar workspace/dd-java-agent/build/libs/dd-java-agent.jar # we upload two filenames |
| 834 | + - gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-java-agent/build/libs/dd-java-agent.jar |
| 835 | + - gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-java-agent/build/libs/dd-java-agent-${VERSION}.jar |
| 836 | + - gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-trace-api/build/libs/dd-trace-api-${VERSION}.jar |
| 837 | + - gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-trace-ot/build/libs/dd-trace-ot-${VERSION}.jar |
| 838 | + after_script: |
| 839 | + - dd-octo-sts revoke -t $(cat github-token.txt) |
| 840 | + retry: |
| 841 | + max: 2 |
| 842 | + when: always |
| 843 | + |
| 844 | +# This is the original job that uses the AWS SSM token retrieval method. Allow manual triggering in case the dd-octo-sts token is not working. |
| 845 | +# TODO: Remove this job once the dd-octo-sts token is provably working. |
| 846 | +deploy_artifacts_to_github_old: |
| 847 | + stage: publish |
| 848 | + image: registry.ddbuild.io/github-cli:v27480869-eafb11d-2.43.0 |
| 849 | + rules: |
| 850 | + - if: '$POPULATE_CACHE' |
| 851 | + when: never |
| 852 | + - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' |
| 853 | + when: manual |
| 854 | + # Requires the deploy_to_maven_central job to have run first (the UP-TO-DATE gradle check across jobs is broken) |
| 855 | + # This will deploy the artifacts built from the publishToSonatype task to the GitHub release |
814 | 856 | needs: |
815 | 857 | - job: deploy_to_maven_central |
816 | 858 | # The deploy_to_maven_central job is not run for release candidate versions |
@@ -839,48 +881,9 @@ requirements_json_test: |
839 | 881 | package-oci: |
840 | 882 | needs: [ build ] |
841 | 883 |
|
842 | | -# "needs" parameters are taken from the one-pipeline template: https://github.com/DataDog/libdatadog-build/blob/main/templates/one-pipeline.yml |
843 | | -# but with an additional dependency on the deploy_to_maven_central job. |
844 | | -internal-publish-lib-init-tags: |
845 | | - stage: publish-oci-images |
846 | | - needs: |
847 | | - - job: deploy_to_maven_central |
848 | | - - job: generate-lib-init-pinned-tag-values |
849 | | - artifacts: true |
850 | | - - job: create-multiarch-lib-injection-image |
851 | | - |
852 | | -promote-oci-to-prod: |
853 | | - stage: publish-oci-images |
854 | | - needs: |
855 | | - - job: deploy_to_maven_central |
856 | | - - job: package-oci |
857 | | - artifacts: true |
858 | | - - job: oci-internal-publish |
859 | | - artifacts: true |
860 | | - |
861 | | -promote-oci-to-prod-beta: |
862 | | - stage: publish-oci-images |
863 | | - needs: |
864 | | - - job: package-oci |
865 | | - artifacts: true |
866 | | - - job: oci-internal-publish |
867 | | - artifacts: true |
868 | | - |
869 | | -promote-oci-to-staging: |
870 | | - stage: publish-oci-images |
871 | | - needs: |
872 | | - - job: package-oci |
873 | | - artifacts: true |
874 | | - - job: oci-internal-publish |
875 | | - artifacts: true |
876 | | - |
877 | | -publish-lib-init-pinned-tags: |
878 | | - stage: publish-oci-images |
879 | | - needs: |
880 | | - - job: deploy_to_maven_central |
881 | | - - job: generate-lib-init-pinned-tag-values |
882 | | - artifacts: true |
883 | | - - job: create-multiarch-lib-injection-image |
| 884 | +# Publish OCI images after deployment to Maven Central is successful. |
| 885 | +publishing-gate: |
| 886 | + needs: [ deploy_to_maven_central ] |
884 | 887 |
|
885 | 888 | configure_system_tests: |
886 | 889 | variables: |
|
0 commit comments