Skip to content

Commit f42cb1e

Browse files
committed
DATAMONGO-2280 - Use parent 'artifactory' profile for snapshot releases.
1 parent a9403b5 commit f42cb1e

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,7 +24,8 @@ pipeline {
2324
agent {
2425
docker {
2526
image 'springci/spring-data-openjdk8-with-mongodb-4.0: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') }
@@ -34,7 +36,7 @@ pipeline {
3436
sh 'sleep 10'
3537
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
3638
sh 'sleep 15'
37-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw clean dependency:list test -Dsort -B'
39+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -B'
3840
}
3941
}
4042

@@ -49,7 +51,8 @@ pipeline {
4951
agent {
5052
docker {
5153
image 'adoptopenjdk/openjdk8:latest'
52-
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
54+
label 'data'
55+
args '-v $HOME:/tmp/jenkins-home'
5356
}
5457
}
5558
options { timeout(time: 20, unit: 'MINUTES') }
@@ -60,7 +63,14 @@ pipeline {
6063

6164
steps {
6265
sh 'rm -rf ?'
63-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B'
66+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
67+
'-Dartifactory.server=https://repo.spring.io ' +
68+
"-Dartifactory.username=${ARTIFACTORY_USR} " +
69+
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
70+
"-Dartifactory.staging-repository=libs-snapshot-local " +
71+
"-Dartifactory.build-name=spring-data-mongodb-2.1 " +
72+
"-Dartifactory.build-number=${BUILD_NUMBER} " +
73+
'-Dmaven.test.skip=true clean deploy -B'
6474
}
6575
}
6676

@@ -71,7 +81,8 @@ pipeline {
7181
agent {
7282
docker {
7383
image 'adoptopenjdk/openjdk8:latest'
74-
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
84+
label 'data'
85+
args '-v $HOME:/tmp/jenkins-home'
7586
}
7687
}
7788
options { timeout(time: 20, unit: 'MINUTES') }
@@ -82,7 +93,14 @@ pipeline {
8293

8394
steps {
8495
sh 'rm -rf ?'
85-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B'
96+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
97+
'-Dartifactory.server=https://repo.spring.io ' +
98+
"-Dartifactory.username=${ARTIFACTORY_USR} " +
99+
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
100+
"-Dartifactory.staging-repository=libs-snapshot-local " +
101+
"-Dartifactory.build-name=spring-data-mongodb-2.1 " +
102+
"-Dartifactory.build-number=${BUILD_NUMBER} " +
103+
'-Dmaven.test.skip=true clean deploy -B'
86104
}
87105
}
88106
}

pom.xml

-40
Original file line numberDiff line numberDiff line change
@@ -115,46 +115,6 @@
115115

116116
<profiles>
117117

118-
<profile>
119-
<id>snapshot</id>
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-mongodb</zip.name>
139-
<zip.displayname>spring-data-mongodb</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>
157-
158118
<profile>
159119
<id>release</id>
160120
<build>

0 commit comments

Comments
 (0)