Skip to content

Commit e3385d1

Browse files
Merge branch 'ci-do-not-leak-secrets' into dev
2 parents 4d1e65a + a4c99b6 commit e3385d1

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

Jenkinsfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ pipeline {
1414
GITLAB_URL = credentials('gitlab_url')
1515
MVN_REPO_LOGIN = credentials('objectbox_internal_mvn_user')
1616
MVN_REPO_URL = credentials('objectbox_internal_mvn_repo_http')
17-
MVN_REPO_ARGS = "-PinternalObjectBoxRepo=$MVN_REPO_URL " +
18-
"-PinternalObjectBoxRepoUser=$MVN_REPO_LOGIN_USR " +
19-
"-PinternalObjectBoxRepoPassword=$MVN_REPO_LOGIN_PSW"
17+
// Warning: use single quotes to avoid Groovy String interpolation leaking secrets.
18+
MVN_REPO_ARGS = '-PinternalObjectBoxRepo=$MVN_REPO_URL ' +
19+
'-PinternalObjectBoxRepoUser=$MVN_REPO_LOGIN_USR ' +
20+
'-PinternalObjectBoxRepoPassword=$MVN_REPO_LOGIN_PSW'
2021
MVN_REPO_UPLOAD_URL = credentials('objectbox_internal_mvn_repo')
21-
MVN_REPO_UPLOAD_ARGS = "-PpreferredRepo=$MVN_REPO_UPLOAD_URL " +
22-
"-PpreferredUsername=$MVN_REPO_LOGIN_USR " +
23-
"-PpreferredPassword=$MVN_REPO_LOGIN_PSW " +
24-
"-PversionPostFix=$versionPostfix"
22+
MVN_REPO_UPLOAD_ARGS = '-PpreferredRepo=$MVN_REPO_UPLOAD_URL ' +
23+
'-PpreferredUsername=$MVN_REPO_LOGIN_USR ' +
24+
'-PpreferredPassword=$MVN_REPO_LOGIN_PSW ' +
25+
'-PversionPostFix=$versionPostfix'
2526
// Note: for key use Jenkins secret file with PGP key as text in ASCII-armored format.
2627
ORG_GRADLE_PROJECT_signingKeyFile = credentials('objectbox_signing_key')
2728
ORG_GRADLE_PROJECT_signingKeyId = credentials('objectbox_signing_key_id')
@@ -81,9 +82,10 @@ pipeline {
8182

8283
// Note: supply internal Maven repo as tests use native dependencies (can't publish those without the Java libraries).
8384
// Note: add quotes around URL parameter to avoid line breaks due to semicolon in URL.
85+
// Warning: use single quotes to avoid Groovy String interpolation leaking secrets.
8486
sh "./gradlew $gradleArgs $MVN_REPO_ARGS " +
85-
"\"-PpreferredRepo=${BINTRAY_URL}\" -PpreferredUsername=${BINTRAY_LOGIN_USR} -PpreferredPassword=${BINTRAY_LOGIN_PSW} " +
86-
"uploadArchives"
87+
'\"-PpreferredRepo=$BINTRAY_URL\" -PpreferredUsername=$BINTRAY_LOGIN_USR -PpreferredPassword=$BINTRAY_LOGIN_PSW ' +
88+
'uploadArchives'
8789

8890
googlechatnotification url: 'id:gchat_java',
8991
message: "Published ${currentBuild.fullDisplayName} successfully to Bintray - check https://bintray.com/objectbox/objectbox\n${env.BUILD_URL}"

ci/Jenkinsfile-Windows

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ pipeline {
1010
GITLAB_URL = credentials('gitlab_url')
1111
MVN_REPO_URL = credentials('objectbox_internal_mvn_repo_http')
1212
MVN_REPO_LOGIN = credentials('objectbox_internal_mvn_user')
13-
MVN_REPO_ARGS = "-PinternalObjectBoxRepo=$MVN_REPO_URL " +
14-
"-PinternalObjectBoxRepoUser=$MVN_REPO_LOGIN_USR " +
15-
"-PinternalObjectBoxRepoPassword=$MVN_REPO_LOGIN_PSW"
13+
// Warning: use single quotes to avoid Groovy String interpolation leaking secrets.
14+
MVN_REPO_ARGS = '-PinternalObjectBoxRepo=%MVN_REPO_URL% ' +
15+
'-PinternalObjectBoxRepoUser=%MVN_REPO_LOGIN_USR% ' +
16+
'-PinternalObjectBoxRepoPassword=%MVN_REPO_LOGIN_PSW%'
1617
}
1718

1819
options {

0 commit comments

Comments
 (0)