Skip to content

Commit 07058c0

Browse files
committed
Add artifactory credentials to build
1 parent 5f51688 commit 07058c0

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.github/workflows/continuous-integration-workflow.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ env:
1111
GRADLE_ENTERPRISE_CACHE_USER: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
1212
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
1313
GRADLE_ENTERPRISE_SECRET_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
14+
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
15+
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
1416

1517
jobs:
1618
build:
@@ -37,7 +39,7 @@ jobs:
3739
export GRADLE_ENTERPRISE_CACHE_USERNAME="$GRADLE_ENTERPRISE_CACHE_USER"
3840
export GRADLE_ENTERPRISE_CACHE_PASSWORD="$GRADLE_ENTERPRISE_CACHE_PASSWORD"
3941
export GRADLE_ENTERPRISE_ACCESS_KEY="$GRADLE_ENTERPRISE_SECRET_ACCESS_KEY"
40-
./gradlew clean build --no-daemon --stacktrace
42+
./gradlew clean build -PartifactoryUsername="$ARTIFACTORY_USERNAME" -PartifactoryPassword="$ARTIFACTORY_PASSWORD" --no-daemon --stacktrace
4143
artifacts:
4244
name: Deploy Artifacts
4345
needs: [build]

build.gradle

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@ buildscript {
1010
repositories {
1111
gradlePluginPortal()
1212
maven { url 'https://repo.spring.io/plugins-release/' }
13-
maven { url 'https://repo.spring.io/plugins-snapshot' }
13+
maven {
14+
url = 'https://repo.spring.io/plugins-snapshot'
15+
if (project.hasProperty('artifactoryUsername')) {
16+
credentials {
17+
username "$artifactoryUsername"
18+
password "$artifactoryPassword"
19+
}
20+
}
21+
}
1422
}
1523

1624
dependencies {
17-
classpath 'io.spring.gradle:spring-build-conventions:0.0.34.RELEASE'
25+
classpath 'io.spring.gradle:spring-build-conventions:0.0.35.RELEASE'
1826
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
1927
}
2028
}

0 commit comments

Comments
 (0)