Skip to content

Commit 9488168

Browse files
Use token to access Akka secure repository
1 parent 860a603 commit 9488168

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.gitlab-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,16 @@ default:
160160
policy: $BUILD_CACHE_POLICY
161161
before_script:
162162
- source .gitlab/gitlab-utils.sh
163+
# Akka token added to SSM from https://account.akka.io/token
164+
- export AKKA_REPO_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.akka_repo_token --with-decryption --query "Parameter.Value" --out text)
163165
- mkdir -p .gradle
164166
- export GRADLE_USER_HOME=$(pwd)/.gradle
165167
- |
166168
# Don't put jvm args here as it will be picked up by child gradle processes used in tests
167169
cat << EOF > $GRADLE_USER_HOME/gradle.properties
168170
mavenRepositoryProxy=$MAVEN_REPOSITORY_PROXY
169171
gradlePluginProxy=$GRADLE_PLUGIN_PROXY
172+
akkaRepositoryToken=$AKKA_REPO_TOKEN
170173
EOF
171174
- |
172175
# replace maven central part by MAVEN_REPOSITORY_PROXY in .mvn/wrapper/maven-wrapper.properties

dd-java-agent/instrumentation/akka-http/akka-http-10.6/build.gradle

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,27 @@ muzzle {
1515
versions = "[10.6.0,)"
1616
javaVersion = "11"
1717
extraDependency 'com.typesafe.akka:akka-stream_2.13:2.9.0'
18-
extraRepository('akka', 'https://repo.akka.io/maven')
18+
19+
if (project.rootProject.hasProperty("akkaRepositoryToken")) {
20+
extraRepository('akka', "https://repo.akka.io/${project.rootProject.property("akkaRepositoryToken")}/secure")
21+
} else {
22+
extraRepository('akka', 'https://repo.akka.io/maven')
23+
}
24+
1925
assertInverse = true
2026
}
2127

2228
}
2329

2430
repositories {
25-
maven {
26-
url "https://repo.akka.io/maven"
31+
if (project.rootProject.hasProperty("akkaRepositoryToken")) {
32+
maven {
33+
url "https://repo.akka.io/${project.rootProject.property("akkaRepositoryToken")}/secure"
34+
}
35+
} else {
36+
maven {
37+
url "https://repo.akka.io/maven"
38+
}
2739
}
2840
}
2941

0 commit comments

Comments
 (0)