Skip to content

Commit c0a2266

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

File tree

2 files changed

+29
-51
lines changed

2 files changed

+29
-51
lines changed

Jenkinsfile

+29-11
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 {
@@ -17,7 +18,7 @@ pipeline {
1718
when {
1819
changeset "ci/openjdk8-mongodb-4.0/**"
1920
}
20-
agent any
21+
agent { label 'data' }
2122
options { timeout(time: 30, unit: 'MINUTES') }
2223

2324
steps {
@@ -33,7 +34,7 @@ pipeline {
3334
when {
3435
changeset "ci/openjdk8-mongodb-4.1/**"
3536
}
36-
agent any
37+
agent { label 'data' }
3738
options { timeout(time: 30, unit: 'MINUTES') }
3839

3940
steps {
@@ -58,7 +59,8 @@ pipeline {
5859
agent {
5960
docker {
6061
image 'springci/spring-data-openjdk8-with-mongodb-4.0:latest'
61-
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
62+
label 'data'
63+
args '-v $HOME:/tmp/jenkins-home'
6264
}
6365
}
6466
options { timeout(time: 30, unit: 'MINUTES') }
@@ -69,7 +71,7 @@ pipeline {
6971
sh 'sleep 10'
7072
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
7173
sh 'sleep 15'
72-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw clean dependency:list test -Dsort -B'
74+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -B'
7375
}
7476
}
7577

@@ -84,9 +86,9 @@ pipeline {
8486
stage("test: mongodb 4.1") {
8587
agent {
8688
docker {
87-
label 'data'
8889
image 'springci/spring-data-openjdk8-with-mongodb-4.1:latest'
89-
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
90+
label 'data'
91+
args '-v $HOME:/tmp/jenkins-home'
9092
}
9193
}
9294
options { timeout(time: 30, unit: 'MINUTES') }
@@ -97,7 +99,7 @@ pipeline {
9799
sh 'sleep 10'
98100
sh 'mongo --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"'
99101
sh 'sleep 15'
100-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw clean dependency:list test -Dsort -B'
102+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw clean dependency:list test -Dsort -B'
101103
}
102104
}
103105
}
@@ -111,7 +113,8 @@ pipeline {
111113
agent {
112114
docker {
113115
image 'adoptopenjdk/openjdk8:latest'
114-
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
116+
label 'data'
117+
args '-v $HOME:/tmp/jenkins-home'
115118
}
116119
}
117120
options { timeout(time: 20, unit: 'MINUTES') }
@@ -122,7 +125,14 @@ pipeline {
122125

123126
steps {
124127
sh 'rm -rf ?'
125-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B'
128+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
129+
'-Dartifactory.server=https://repo.spring.io ' +
130+
"-Dartifactory.username=${ARTIFACTORY_USR} " +
131+
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
132+
"-Dartifactory.staging-repository=libs-snapshot-local " +
133+
"-Dartifactory.build-name=spring-data-mongodb " +
134+
"-Dartifactory.build-number=${BUILD_NUMBER} " +
135+
'-Dmaven.test.skip=true clean deploy -B'
126136
}
127137
}
128138

@@ -133,7 +143,8 @@ pipeline {
133143
agent {
134144
docker {
135145
image 'adoptopenjdk/openjdk8:latest'
136-
args '-v $HOME/.m2:/tmp/spring-data-maven-repository'
146+
label 'data'
147+
args '-v $HOME:/tmp/jenkins-home'
137148
}
138149
}
139150
options { timeout(time: 20, unit: 'MINUTES') }
@@ -144,7 +155,14 @@ pipeline {
144155

145156
steps {
146157
sh 'rm -rf ?'
147-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/spring-data-maven-repository" ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B'
158+
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -Pci,artifactory ' +
159+
'-Dartifactory.server=https://repo.spring.io ' +
160+
"-Dartifactory.username=${ARTIFACTORY_USR} " +
161+
"-Dartifactory.password=${ARTIFACTORY_PSW} " +
162+
"-Dartifactory.staging-repository=libs-snapshot-local " +
163+
"-Dartifactory.build-name=spring-data-mongodb " +
164+
"-Dartifactory.build-number=${BUILD_NUMBER} " +
165+
'-Dmaven.test.skip=true clean deploy -B'
148166
}
149167
}
150168
}

pom.xml

-40
Original file line numberDiff line numberDiff line change
@@ -114,46 +114,6 @@
114114

115115
<profiles>
116116

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

0 commit comments

Comments
 (0)