Skip to content

Commit 4c17c50

Browse files
committed
Edit gitlab-ci.yml file
1 parent e726ef0 commit 4c17c50

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

.gitlab-ci.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -812,29 +812,25 @@ deploy_artifacts_to_github:
812812
rules:
813813
- if: '$POPULATE_CACHE'
814814
when: never
815-
# - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
816-
# when: on_success
815+
# - if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
816+
# when: on_success
817817
- when: manual # DEBUG: Allow manual trigger
818818
allow_failure: true
819-
820-
needs: [] # DEBUG: Enforce no dependencies to run immediately
819+
820+
# Requires the deploy_to_maven_central job to have run first (the UP-TO-DATE gradle check across jobs is broken)
821+
# This will deploy the artifacts built from the publishToSonatype task to the GitHub release
822+
needs: [] # DEBUG: Enforce no dependencies for now to run immediately
821823
# - job: deploy_to_maven_central
822824
# # The deploy_to_maven_central job is not run for release candidate versions
823825
# optional: true
824826

825827
before_script:
826828
# Get a token
827829
- dd-octo-sts version
828-
- dd-octo-sts debug --scope DataDog/dd-trace-java --policy self.gitlab.release
829-
# - dd-octo-sts token --scope DataDog/dd-trace-java --policy self.gitlab.release > github-token.txt
830+
- dd-octo-sts debug --scope DataDog/dd-trace-java --policy self.gitlab.release # Uncomment to debug the token
831+
- dd-octo-sts token --scope DataDog/dd-trace-java --policy self.gitlab.release > github-token.txt
830832

831833
script:
832-
- aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.gh_release_token --with-decryption --query "Parameter.Value" --out text > github-token.txt
833-
# Verify token was generated
834-
- echo "Token file exists:" $(test -f github-token.txt && echo "YES" || echo "NO")
835-
- echo "Token file size:" $(wc -c < github-token.txt) "bytes"
836-
- echo "Token preview:" $(head -c 10 github-token.txt)...
837-
838834
- gh auth login --with-token < github-token.txt
839835
- gh auth status # Maybe helpful to have this output in logs?
840836
# - export VERSION=${CI_COMMIT_TAG##v} # remove "v" from front of tag to get version
@@ -844,9 +840,9 @@ deploy_artifacts_to_github:
844840
# - gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-trace-api/build/libs/dd-trace-api-${VERSION}.jar
845841
# - gh release upload --clobber --repo DataDog/dd-trace-java $CI_COMMIT_TAG workspace/dd-trace-ot/build/libs/dd-trace-ot-${VERSION}.jar
846842

847-
# after_script:
848-
# # Revoke the token after usage
849-
# - dd-octo-sts revoke -t $(cat github-token.txt)
843+
after_script:
844+
# Revoke the token after usage
845+
- dd-octo-sts revoke -t $(cat github-token.txt)
850846

851847
retry:
852848
max: 2

0 commit comments

Comments
 (0)