Skip to content

Commit f25c70a

Browse files
marko-bekhtasebersole
authored andcommitted
HHH-18488 Add a CI check for build reproducibility
1 parent 2ada4ac commit f25c70a

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

nightly.Jenkinsfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)