@@ -14,14 +14,15 @@ pipeline {
14
14
GITLAB_URL = credentials(' gitlab_url' )
15
15
MVN_REPO_LOGIN = credentials(' objectbox_internal_mvn_user' )
16
16
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'
20
21
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'
25
26
// Note: for key use Jenkins secret file with PGP key as text in ASCII-armored format.
26
27
ORG_GRADLE_PROJECT_signingKeyFile = credentials(' objectbox_signing_key' )
27
28
ORG_GRADLE_PROJECT_signingKeyId = credentials(' objectbox_signing_key_id' )
@@ -81,9 +82,10 @@ pipeline {
81
82
82
83
// Note: supply internal Maven repo as tests use native dependencies (can't publish those without the Java libraries).
83
84
// 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.
84
86
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'
87
89
88
90
googlechatnotification url : ' id:gchat_java' ,
89
91
message : " Published ${ currentBuild.fullDisplayName} successfully to Bintray - check https://bintray.com/objectbox/objectbox\n ${ env.BUILD_URL} "
0 commit comments