Skip to content

Commit 27f2391

Browse files
committed
Provide artifactoryUsername/Password
1 parent 9b29edd commit 27f2391

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

Jenkinsfile

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ try {
3333
sh "git clean -dfx"
3434
try {
3535
withCredentials([GRADLE_ENTERPRISE_CACHE_USER,
36-
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY]) {
36+
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY,
37+
ARTIFACTORY_CREDENTIALS]) {
3738
withEnv([jdkEnv(),
3839
"GRADLE_ENTERPRISE_CACHE_USERNAME=${GRADLE_ENTERPRISE_CACHE_USERNAME}",
3940
"GRADLE_ENTERPRISE_CACHE_PASSWORD=${GRADLE_ENTERPRISE_CACHE_PASSWORD}",
4041
"GRADLE_ENTERPRISE_ACCESS_KEY=${GRADLE_ENTERPRISE_ACCESS_KEY}"]) {
41-
sh "./gradlew check --stacktrace"
42+
sh "./gradlew check -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD --stacktrace"
4243
}
4344
}
4445
} catch(Exception e) {
@@ -57,16 +58,17 @@ try {
5758
sh "git clean -dfx"
5859
withCredentials([SONAR_LOGIN_CREDENTIALS,
5960
GRADLE_ENTERPRISE_CACHE_USER,
60-
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY]) {
61+
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY,
62+
ARTIFACTORY_CREDENTIALS]) {
6163
try {
6264
withEnv([jdkEnv(),
6365
"GRADLE_ENTERPRISE_CACHE_USERNAME=${GRADLE_ENTERPRISE_CACHE_USERNAME}",
6466
"GRADLE_ENTERPRISE_CACHE_PASSWORD=${GRADLE_ENTERPRISE_CACHE_PASSWORD}",
6567
"GRADLE_ENTERPRISE_ACCESS_KEY=${GRADLE_ENTERPRISE_ACCESS_KEY}"]) {
6668
if ("master" == env.BRANCH_NAME) {
67-
sh "./gradlew sonarqube -PexcludeProjects='**/samples/**' -Dsonar.host.url=$SPRING_SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN --stacktrace"
69+
sh "./gradlew sonarqube -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD -PexcludeProjects='**/samples/**' -Dsonar.host.url=$SPRING_SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN --stacktrace"
6870
} else {
69-
sh "./gradlew sonarqube -PexcludeProjects='**/samples/**' -Dsonar.projectKey='spring-security-${env.BRANCH_NAME}' -Dsonar.projectName='spring-security-${env.BRANCH_NAME}' -Dsonar.host.url=$SPRING_SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN --stacktrace"
71+
sh "./gradlew sonarqube -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD -PexcludeProjects='**/samples/**' -Dsonar.projectKey='spring-security-${env.BRANCH_NAME}' -Dsonar.projectName='spring-security-${env.BRANCH_NAME}' -Dsonar.host.url=$SPRING_SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN --stacktrace"
7072
}
7173
}
7274
} catch(Exception e) {
@@ -84,12 +86,13 @@ try {
8486
sh "git clean -dfx"
8587
try {
8688
withCredentials([GRADLE_ENTERPRISE_CACHE_USER,
87-
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY]) {
89+
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY,
90+
ARTIFACTORY_CREDENTIALS]) {
8891
withEnv([jdkEnv(),
8992
"GRADLE_ENTERPRISE_CACHE_USERNAME=${GRADLE_ENTERPRISE_CACHE_USERNAME}",
9093
"GRADLE_ENTERPRISE_CACHE_PASSWORD=${GRADLE_ENTERPRISE_CACHE_PASSWORD}",
9194
"GRADLE_ENTERPRISE_ACCESS_KEY=${GRADLE_ENTERPRISE_ACCESS_KEY}"]) {
92-
sh "./gradlew test --refresh-dependencies -PforceMavenRepositories=snapshot -PspringVersion='5.2.+' -PreactorVersion='Dysprosium-BUILD-SNAPSHOT' -PspringDataVersion='Neumann-BUILD-SNAPSHOT' -PrsocketVersion='1.0.+' -PspringBootVersion='2.3.+' -PlocksDisabled --stacktrace"
95+
sh "./gradlew test -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD --refresh-dependencies -PforceMavenRepositories=snapshot -PspringVersion='5.2.+' -PreactorVersion='Dysprosium-BUILD-SNAPSHOT' -PspringDataVersion='Neumann-BUILD-SNAPSHOT' -PrsocketVersion='1.0.+' -PspringBootVersion='2.3.+' -PlocksDisabled --stacktrace"
9396
}
9497
}
9598
} catch(Exception e) {
@@ -107,12 +110,13 @@ try {
107110
try {
108111

109112
withCredentials([GRADLE_ENTERPRISE_CACHE_USER,
110-
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY]) {
113+
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY,
114+
ARTIFACTORY_CREDENTIALS]) {
111115
withEnv([jdkEnv("jdk11"),
112116
"GRADLE_ENTERPRISE_CACHE_USERNAME=${GRADLE_ENTERPRISE_CACHE_USERNAME}",
113117
"GRADLE_ENTERPRISE_CACHE_PASSWORD=${GRADLE_ENTERPRISE_CACHE_PASSWORD}",
114118
"GRADLE_ENTERPRISE_ACCESS_KEY=${GRADLE_ENTERPRISE_ACCESS_KEY}"]) {
115-
sh "./gradlew test --stacktrace"
119+
sh "./gradlew test -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD --stacktrace"
116120
}
117121
}
118122
} catch(Exception e) {
@@ -129,12 +133,13 @@ try {
129133
sh "git clean -dfx"
130134
try {
131135
withCredentials([GRADLE_ENTERPRISE_CACHE_USER,
132-
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY]) {
136+
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY,
137+
ARTIFACTORY_CREDENTIALS]) {
133138
withEnv([jdkEnv("openjdk12"),
134139
"GRADLE_ENTERPRISE_CACHE_USERNAME=${GRADLE_ENTERPRISE_CACHE_USERNAME}",
135140
"GRADLE_ENTERPRISE_CACHE_PASSWORD=${GRADLE_ENTERPRISE_CACHE_PASSWORD}",
136141
"GRADLE_ENTERPRISE_ACCESS_KEY=${GRADLE_ENTERPRISE_ACCESS_KEY}"]) {
137-
sh "./gradlew test --stacktrace"
142+
sh "./gradlew test -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD --stacktrace"
138143
}
139144
}
140145
} catch(Exception e) {

0 commit comments

Comments
 (0)