File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,35 @@ stage('Build') {
204204 }
205205 })
206206 }
207+ // Don't run additional checks when this is a PR
208+ if ( !helper.scmSource.pullRequest ) {
209+ executions.put('Reproducible build check', {
210+ runBuildOnNode(NODE_PATTERN_BASE) {
211+ def javaHome = tool(name: DEFAULT_JDK_TOOL, type: 'jdk')
212+ // Use withEnv instead of setting env directly, as that is global!
213+ // See https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md
214+ withEnv(["JAVA_HOME=${javaHome}", "PATH+JAVA=${javaHome}/bin"]) {
215+ stage('Checkout') {
216+ checkout scm
217+ }
218+ stage('Test') {
219+ withGradle {
220+ def tempDir = pwd(tmp: true)
221+ def repo1 = tempDir + '/repo1'
222+ def repo2 = tempDir + '/repo2'
223+ // build Hibernate ORM two times without any cache and "publish" the resulting artifacts to different maven repositories
224+ // so that we can compare them afterwards:
225+ sh "./gradlew --no-daemon clean publishToMavenLocal --no-build-cache -Dmaven.repo.local=$repo1"
226+ sh "./gradlew --no-daemon clean publishToMavenLocal --no-build-cache -Dmaven.repo.local=$repo2"
227+
228+ sh "sh ci/compare-build-results.sh $repo1 $repo2"
229+ sh "cat .buildcompare"
230+ }
231+ }
232+ }
233+ }
234+ })
235+ }
207236 parallel(executions)
208237}
209238
You can’t perform that action at this time.
0 commit comments