Skip to content

Commit 22811b3

Browse files
authored
chore(gradle): Propagate maven central proxy to child gradle process (#8975)
* chore(gradle): Propagate maven central proxy to child gradle process via user gradle.properties * chore(ci): Enable script sections in gitlab
1 parent 0b95f68 commit 22811b3

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.gitlab-ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ stages:
2020
- generate-signing-key
2121

2222
variables:
23+
# Gitlab runner features; see https://docs.gitlab.com/runner/configuration/feature-flags.html
24+
# Fold and time all script sections
25+
FF_SCRIPT_SECTIONS: 1
26+
2327
REGISTRY: 486234852809.dkr.ecr.us-east-1.amazonaws.com
2428
BUILD_JOB_NAME: "build"
2529
DEPENDENCY_CACHE_POLICY: pull
@@ -133,8 +137,14 @@ default:
133137
before_script:
134138
- source .gitlab/gitlab-utils.sh
135139
- export GRADLE_USER_HOME=`pwd`/.gradle
140+
- |
141+
# Don't put jvm args here as it will be picked up by child gradle processes used in tests
142+
cat << EOF > $GRADLE_USER_HOME/gradle.properties
143+
mavenRepositoryProxy=$MAVEN_REPOSITORY_PROXY
144+
gradlePluginProxy=$GRADLE_PLUGIN_PROXY
145+
EOF
136146
- export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx$GRADLE_MEM -Xms$GRADLE_MEM -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'"
137-
- export GRADLE_ARGS=" --build-cache --stacktrace --no-daemon --parallel --max-workers=$GRADLE_WORKERS -PmavenRepositoryProxy=$MAVEN_REPOSITORY_PROXY -PgradlePluginProxy=$GRADLE_PLUGIN_PROXY"
147+
- export GRADLE_ARGS=" --build-cache --stacktrace --no-daemon --parallel --max-workers=$GRADLE_WORKERS"
138148
- *normalize_node_index
139149
# for weird reasons, gradle will always "chmod 700" the .gradle folder
140150
# with Gitlab caching, .gradle is always owned by root and thus gradle's chmod invocation fails

gradle/repositories.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
repositories {
22
mavenLocal()
3+
if (project.rootProject.name != "dd-trace-java" && project.rootProject.name != "buildSrc") {
4+
logger.lifecycle("Using maven repository proxy: " + project.rootProject.findProperty("mavenRepositoryProxy"))
5+
}
36
if (project.rootProject.hasProperty("mavenRepositoryProxy")) {
47
maven {
58
url project.rootProject.property("mavenRepositoryProxy")

0 commit comments

Comments
 (0)