Skip to content

Commit 0577999

Browse files
committed
DATAKV-264 - Use parent 'artifactory' profile for snapshot releases.
1 parent 8070fd7 commit 0577999

File tree

2 files changed

+24
-46
lines changed

2 files changed

+24
-46
lines changed

Jenkinsfile

+24-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pipeline {
88

99
options {
1010
disableConcurrentBuilds()
11+
buildDiscarder(logRotator(numToKeepStr: '14'))
1112
}
1213

1314
stages {
@@ -23,13 +24,14 @@ pipeline {
2324
agent {
2425
docker {
2526
image 'adoptopenjdk/openjdk8:latest'
26-
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
27+
label 'data'
28+
args '-v $HOME:/tmp/jenkins-home'
2729
}
2830
}
2931
options { timeout(time: 30, unit: 'MINUTES') }
3032
steps {
3133
sh 'rm -rf ?'
32-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw clean dependency:list test -Dsort -B'
34+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -B'
3335
}
3436
}
3537
}
@@ -42,7 +44,8 @@ pipeline {
4244
agent {
4345
docker {
4446
image 'adoptopenjdk/openjdk8:latest'
45-
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
47+
label 'data'
48+
args '-v $HOME:/tmp/jenkins-home'
4649
}
4750
}
4851
options { timeout(time: 20, unit: 'MINUTES') }
@@ -53,7 +56,14 @@ pipeline {
5356

5457
steps {
5558
sh 'rm -rf ?'
56-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B'
59+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
60+
'-Dartifactory.server=https://repo.spring.io ' +
61+
"-Dartifactory.username=${ARTIFACTORY_USR} " +
62+
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
63+
"-Dartifactory.staging-repository=libs-snapshot-local " +
64+
"-Dartifactory.build-name=spring-data-keyvalue " +
65+
"-Dartifactory.build-number=${BUILD_NUMBER} " +
66+
'-Dmaven.test.skip=true clean deploy -B'
5767
}
5868
}
5969
stage('Release to artifactory with docs') {
@@ -63,7 +73,8 @@ pipeline {
6373
agent {
6474
docker {
6575
image 'adoptopenjdk/openjdk8:latest'
66-
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
76+
label 'data'
77+
args '-v $HOME:/tmp/jenkins-home'
6778
}
6879
}
6980
options { timeout(time: 20, unit: 'MINUTES') }
@@ -74,7 +85,14 @@ pipeline {
7485

7586
steps {
7687
sh 'rm -rf ?'
77-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B'
88+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
89+
'-Dartifactory.server=https://repo.spring.io ' +
90+
"-Dartifactory.username=${ARTIFACTORY_USR} " +
91+
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
92+
"-Dartifactory.staging-repository=libs-snapshot-local " +
93+
"-Dartifactory.build-name=spring-data-keyvalue " +
94+
"-Dartifactory.build-number=${BUILD_NUMBER} " +
95+
'-Dmaven.test.skip=true clean deploy -B'
7896
}
7997
}
8098
}

pom.xml

-40
Original file line numberDiff line numberDiff line change
@@ -114,46 +114,6 @@
114114
</build>
115115

116116
<profiles>
117-
<profile>
118-
<id>snapshot</id>
119-
120-
<build>
121-
<plugins>
122-
<plugin>
123-
<groupId>org.jfrog.buildinfo</groupId>
124-
<artifactId>artifactory-maven-plugin</artifactId>
125-
<version>2.6.1</version>
126-
<inherited>false</inherited>
127-
<executions>
128-
<execution>
129-
<id>build-info</id>
130-
<goals>
131-
<goal>publish</goal>
132-
</goals>
133-
<configuration>
134-
<buildInfo>
135-
<buildUrl>{{BUILD_URL}}</buildUrl>
136-
</buildInfo>
137-
<deployProperties>
138-
<zip.name>spring-data-keyvalue</zip.name>
139-
<zip.displayname>spring-data-keyvalue</zip.displayname>
140-
<zip.deployed>false</zip.deployed>
141-
<archives>*:*:*:*@zip</archives>
142-
</deployProperties>
143-
<publisher>
144-
<contextUrl>https://repo.spring.io</contextUrl>
145-
<username>{{ARTIFACTORY_USR}}</username>
146-
<password>{{ARTIFACTORY_PSW}}</password>
147-
<repoKey>libs-snapshot-local</repoKey>
148-
<snapshotRepoKey>libs-snapshot-local</snapshotRepoKey>
149-
</publisher>
150-
</configuration>
151-
</execution>
152-
</executions>
153-
</plugin>
154-
</plugins>
155-
</build>
156-
</profile>
157117
<profile>
158118
<id>release</id>
159119
<build>

0 commit comments

Comments
 (0)