| 
									
										
										
										
											2022-01-31 16:08:57 -06:00
										 |  |  | def p = [:] | 
					
						
							|  |  |  | node { | 
					
						
							|  |  |  |     checkout scm | 
					
						
							|  |  |  |     p = readProperties interpolate: true, file: 'ci/pipeline.properties' | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-15 16:14:44 -05:00
										 |  |  | pipeline { | 
					
						
							| 
									
										
										
										
											2019-07-03 12:41:31 -05:00
										 |  |  | 	agent none | 
					
						
							| 
									
										
										
										
											2019-05-15 16:14:44 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-03 12:41:31 -05:00
										 |  |  | 	triggers { | 
					
						
							|  |  |  | 		pollSCM 'H/10 * * * *' | 
					
						
							| 
									
										
										
										
											2022-03-24 09:26:33 +01:00
										 |  |  | 		upstream(upstreamProjects: "spring-data-commons/main", threshold: hudson.model.Result.SUCCESS) | 
					
						
							| 
									
										
										
										
											2019-07-03 12:41:31 -05:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2019-05-15 16:14:44 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-03 12:41:31 -05:00
										 |  |  | 	options { | 
					
						
							|  |  |  | 		disableConcurrentBuilds() | 
					
						
							|  |  |  | 		buildDiscarder(logRotator(numToKeepStr: '14')) | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2019-05-15 16:14:44 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-03 12:41:31 -05:00
										 |  |  | 	stages { | 
					
						
							| 
									
										
										
										
											2022-02-04 15:22:41 +01:00
										 |  |  | 		stage("test: baseline (Java 17)") { | 
					
						
							| 
									
										
										
										
											2019-11-13 08:29:51 -06:00
										 |  |  | 			when { | 
					
						
							| 
									
										
										
										
											2022-03-24 09:26:33 +01:00
										 |  |  | 				beforeAgent(true) | 
					
						
							| 
									
										
										
										
											2019-11-13 08:29:51 -06:00
										 |  |  | 				anyOf { | 
					
						
							| 
									
										
										
										
											2022-03-24 09:26:33 +01:00
										 |  |  | 					branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP") | 
					
						
							| 
									
										
										
										
											2019-11-13 08:29:51 -06:00
										 |  |  | 					not { triggeredBy 'UpstreamCause' } | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			agent { | 
					
						
							| 
									
										
										
										
											2020-12-15 11:09:24 -06:00
										 |  |  | 				label 'data' | 
					
						
							| 
									
										
										
										
											2019-11-13 08:29:51 -06:00
										 |  |  | 			} | 
					
						
							|  |  |  | 			options { timeout(time: 30, unit: 'MINUTES') } | 
					
						
							| 
									
										
										
										
											2020-12-15 11:10:41 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | 			environment { | 
					
						
							| 
									
										
										
										
											2022-07-18 09:19:36 +02:00
										 |  |  | 				DOCKER_HUB = credentials("${p['docker.credentials']}") | 
					
						
							|  |  |  | 				ARTIFACTORY = credentials("${p['artifactory.credentials']}") | 
					
						
							| 
									
										
										
										
											2020-12-15 11:10:41 -06:00
										 |  |  | 			} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-13 08:29:51 -06:00
										 |  |  | 			steps { | 
					
						
							| 
									
										
										
										
											2020-12-15 11:09:24 -06:00
										 |  |  | 				script { | 
					
						
							| 
									
										
										
										
											2022-07-18 09:19:36 +02:00
										 |  |  | 					docker.withRegistry(p['docker.registry'], p['docker.credentials']) { | 
					
						
							| 
									
										
										
										
											2022-01-31 16:08:57 -06:00
										 |  |  | 						docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.docker']) { | 
					
						
							| 
									
										
										
										
											2020-12-15 11:09:24 -06:00
										 |  |  | 							sh "docker login --username ${DOCKER_HUB_USR} --password ${DOCKER_HUB_PSW}" | 
					
						
							|  |  |  | 							sh 'PROFILE=none ci/verify.sh' | 
					
						
							|  |  |  | 							sh "ci/clean.sh" | 
					
						
							|  |  |  | 						} | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 				} | 
					
						
							| 
									
										
										
										
											2019-11-13 08:29:51 -06:00
										 |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-03 12:41:31 -05:00
										 |  |  | 		stage('Release to artifactory') { | 
					
						
							|  |  |  | 			when { | 
					
						
							| 
									
										
										
										
											2022-03-24 09:26:33 +01:00
										 |  |  | 				beforeAgent(true) | 
					
						
							| 
									
										
										
										
											2019-07-19 11:59:52 -05:00
										 |  |  | 				anyOf { | 
					
						
							| 
									
										
										
										
											2022-03-24 09:26:33 +01:00
										 |  |  | 					branch(pattern: "main|(\\d\\.\\d\\.x)", comparator: "REGEXP") | 
					
						
							| 
									
										
										
										
											2019-07-19 11:59:52 -05:00
										 |  |  | 					not { triggeredBy 'UpstreamCause' } | 
					
						
							|  |  |  | 				} | 
					
						
							| 
									
										
										
										
											2019-07-03 12:41:31 -05:00
										 |  |  | 			} | 
					
						
							|  |  |  | 			agent { | 
					
						
							| 
									
										
										
										
											2020-12-15 11:09:24 -06:00
										 |  |  | 				label 'data' | 
					
						
							| 
									
										
										
										
											2019-07-03 12:41:31 -05:00
										 |  |  | 			} | 
					
						
							|  |  |  | 			options { timeout(time: 20, unit: 'MINUTES') } | 
					
						
							| 
									
										
										
										
											2019-05-15 16:14:44 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-03 12:41:31 -05:00
										 |  |  | 			environment { | 
					
						
							| 
									
										
										
										
											2022-07-18 09:19:36 +02:00
										 |  |  | 				ARTIFACTORY = credentials("${p['artifactory.credentials']}") | 
					
						
							| 
									
										
										
										
											2019-07-03 12:41:31 -05:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2019-05-15 16:14:44 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-03 12:41:31 -05:00
										 |  |  | 			steps { | 
					
						
							| 
									
										
										
										
											2020-12-15 11:09:24 -06:00
										 |  |  | 				script { | 
					
						
							| 
									
										
										
										
											2022-02-04 15:18:17 +01:00
										 |  |  | 					docker.withRegistry(p['docker.registry'], p['docker.credentials']) { | 
					
						
							| 
									
										
										
										
											2022-03-15 14:19:47 +01:00
										 |  |  | 						docker.image(p['docker.java.main.image']).inside(p['docker.java.inside.basic']) { | 
					
						
							| 
									
										
										
										
											2021-04-20 10:40:58 -05:00
										 |  |  | 							sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-elasticsearch-non-root ' + | 
					
						
							| 
									
										
										
										
											2020-12-15 11:09:24 -06:00
										 |  |  | 									'-Dartifactory.server=https://repo.spring.io ' + | 
					
						
							|  |  |  | 									"-Dartifactory.username=${ARTIFACTORY_USR} " + | 
					
						
							|  |  |  | 									"-Dartifactory.password=${ARTIFACTORY_PSW} " + | 
					
						
							|  |  |  | 									"-Dartifactory.staging-repository=libs-snapshot-local " + | 
					
						
							|  |  |  | 									"-Dartifactory.build-name=spring-data-elasticsearch " + | 
					
						
							|  |  |  | 									"-Dartifactory.build-number=${BUILD_NUMBER} " + | 
					
						
							|  |  |  | 									'-Dmaven.test.skip=true clean deploy -U -B' | 
					
						
							|  |  |  | 						} | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 				} | 
					
						
							| 
									
										
										
										
											2019-07-03 12:41:31 -05:00
										 |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2019-05-15 16:14:44 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-03 12:41:31 -05:00
										 |  |  | 	post { | 
					
						
							|  |  |  | 		changed { | 
					
						
							|  |  |  | 			script { | 
					
						
							|  |  |  | 				slackSend( | 
					
						
							|  |  |  | 						color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger', | 
					
						
							|  |  |  | 						channel: '#spring-data-dev', | 
					
						
							|  |  |  | 						message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}") | 
					
						
							|  |  |  | 				emailext( | 
					
						
							|  |  |  | 						subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}", | 
					
						
							|  |  |  | 						mimeType: 'text/html', | 
					
						
							|  |  |  | 						recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']], | 
					
						
							|  |  |  | 						body: "<a href=\"${env.BUILD_URL}\">${currentBuild.fullDisplayName} is reported as ${currentBuild.currentResult}</a>") | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2019-05-15 16:14:44 -05:00
										 |  |  | } |