|
14 | 14 | description: 'The tag/branch to build.' |
15 | 15 | - string: |
16 | 16 | name: BUILD_VERSION |
17 | | - default: '1.0' |
| 17 | + default: '9.9' |
18 | 18 | description: 'Manually set the JTREG version. Only used when TAG parameter is "master"' |
19 | 19 | - string: |
20 | 20 | name: BUILD_NUMBER |
21 | | - default: '0' |
| 21 | + default: '99' |
22 | 22 | description: 'Manually set the JTREG build number. Only used when TAG parameter is "master"' |
23 | 23 | dsl: | |
24 | 24 | pipeline { |
25 | 25 | agent { |
26 | 26 | label 'linux_x86_64' |
27 | 27 | } |
28 | 28 | stages { |
29 | | - stage("Checkout Infrastructure") { |
30 | | - steps { |
31 | | - checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], includedRegions: 'jenkins-job-generator/.*', doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'SapMachine-Infrastructure']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'SapMachine-github', url: 'https://github.com/SAP/SapMachine-infrastructure.git']]] |
32 | | - } |
33 | | - } |
| 29 | + stage("Checkout Infrastructure") { |
| 30 | + steps { |
| 31 | + checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], includedRegions: 'jenkins-job-generator/.*', doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'SapMachine-Infrastructure']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'SapMachine-github', url: 'https://github.com/SAP/SapMachine-infrastructure.git']]] |
| 32 | + } |
| 33 | + } |
34 | 34 | stage('Build') { |
35 | 35 | agent { |
36 | 36 | dockerfile { |
|
41 | 41 | } |
42 | 42 | steps { |
43 | 43 | script { |
| 44 | + def jtregVersion |
| 45 | + def jtregBuild |
44 | 46 | if (params.TAG == "master") { |
45 | | - env.BUILD_NUMBER = params.BUILD_NUMBER |
46 | | - env.BUILD_VERSION = params.BUILD_VERSION |
| 47 | + jtregVersion = params.BUILD_VERSION |
| 48 | + jtregBuild = params.BUILD_NUMBER |
| 49 | + } else { |
| 50 | + def match = params.TAG =~ /jtreg-*([0-9]+(\.[0-9]+)*)((\+|-b)([0-9]+))*/ |
| 51 | + jtregVersion = match[0][1] |
| 52 | + jtregBuild = matcher[0][5] |
| 53 | + if (jtregBuild == null) { |
| 54 | + jtregBuild = "1" |
| 55 | + } else { |
| 56 | + jtregBuild = jtregBuild.toInteger() |
| 57 | + } |
| 58 | + } |
| 59 | + if (version.toFloat() < 6) { |
| 60 | + env.BUILD_VERSION = jtregVersion |
| 61 | + env.BUILD_NUMBER = jtregBuild |
| 62 | + env.BUILD_SCRIPT = "build-all.sh" |
| 63 | + env.VM_OPT = "" |
47 | 64 | } else { |
48 | | - def match = params.TAG =~ /jtreg([0-9]+(\.[0-9]+)*)-(b[0-9]*).*/ |
49 | | - env.BUILD_NUMBER = match[0][2] |
50 | | - env.BUILD_VERSION = match[0][1] |
| 65 | + env.JTREG_VERSION = jtregVersion |
| 66 | + env.JTREG_BUILD_NUMBER = jtregBuild |
| 67 | + env.BUILD_SCRIPT = "build.sh" |
| 68 | + env.VM_OPT = "--jdk" |
51 | 69 | } |
52 | 70 | } |
53 | 71 | sh "rm -rf ${env.WORKSPACE}/jtreg" |
54 | 72 | sh "git clone https://github.com/openjdk/jtreg.git ${env.WORKSPACE}/jtreg" |
55 | 73 | sh "cd ${env.WORKSPACE}/jtreg && git checkout ${params.TAG}" |
56 | | - sh "cd ${env.WORKSPACE}/jtreg && bash make/build.sh --jdk /usr/lib/jvm/java-8-openjdk-*" |
| 74 | + sh "cd ${env.WORKSPACE}/jtreg && bash make/${BUILD_SCRIPT} ${VM_OPT} /usr/lib/jvm/java-8-openjdk-*" |
57 | 75 | sh "cp ${env.WORKSPACE}/jtreg/build/images/jtreg.zip ${env.WORKSPACE}/jtreg.zip" |
58 | 76 | } |
59 | 77 | post { |
|
0 commit comments