Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 1 | - job: |
| 2 | name: jdk11-build-release |
| 3 | project-type: matrix |
| 4 | defaults: global |
| 5 | description: | |
| 6 | * Configures and builds jdk11 for release. Run after the source has passed tests. |
| 7 | * Tags build with Linaro-YYMM as per normal release procedure. |
| 8 | * The source tarball is copied from the jdk11-update-src-tree job.<br> |
| 9 | properties: |
| 10 | - authorization: |
| 11 | anonymous: |
| 12 | - job-read |
| 13 | - job-extended-read |
| 14 | openjdk-members: |
| 15 | - job-build |
| 16 | - job-cancel |
Stuart Monteith | 571d52b | 2019-02-06 14:02:08 +0000 | [diff] [blame] | 17 | - job-workspace |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 18 | - build-discarder: |
| 19 | days-to-keep: 30 |
| 20 | num-to-keep: 10 |
| 21 | artifact-num-to-keep: 5 |
Riku Voipio | b7c49aa | 2020-12-01 15:15:24 +0200 | [diff] [blame] | 22 | disabled: true |
Stuart Monteith | 9aba7c3 | 2018-10-03 18:16:57 +0100 | [diff] [blame] | 23 | node: j12-qrep-01 |
Stuart Monteith | 17cf7ee | 2018-11-12 10:14:24 +0000 | [diff] [blame] | 24 | display-name: 'OpenJDK 11u - Configure and build OpenJDK 11u Release' |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 25 | axes: |
| 26 | - axis: |
| 27 | type: user-defined |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 28 | name: BUILD_TYPE |
| 29 | values: |
| 30 | - release |
| 31 | - axis: |
| 32 | type: slave |
| 33 | name: label |
| 34 | values: |
Stuart Monteith | 9aba7c3 | 2018-10-03 18:16:57 +0100 | [diff] [blame] | 35 | - j12-qrep-01 |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 36 | execution-strategy: |
| 37 | sequential: true |
| 38 | wrappers: |
| 39 | - workspace-cleanup: |
| 40 | dirmatch: false |
| 41 | - timestamps |
| 42 | - matrix-tie-parent: |
Stuart Monteith | 9aba7c3 | 2018-10-03 18:16:57 +0100 | [diff] [blame] | 43 | node: j12-qrep-01 |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 44 | builders: |
| 45 | - copyartifact: |
| 46 | project: jdk11-update-src-tree |
Stuart Monteith | 17cf7ee | 2018-11-12 10:14:24 +0000 | [diff] [blame] | 47 | filter: 'out/jdk11u.tar.gz' |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 48 | target: incoming |
| 49 | flatten: true |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 50 | - shell: | |
| 51 | #!/bin/bash |
| 52 | |
| 53 | set -exu |
| 54 | |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 55 | # Generate files names dependent on year/month. |
| 56 | RELEASE=$(date +%y%m) |
Stuart Monteith | 17cf7ee | 2018-11-12 10:14:24 +0000 | [diff] [blame] | 57 | JDKDIR=jdk11u-${BUILD_TYPE}-${RELEASE} |
| 58 | JDK_SRCDIR=jdk11u-src-${RELEASE} |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 59 | |
| 60 | ccache_build_opts=--disable-ccache |
| 61 | |
Stuart Monteith | 571d52b | 2019-02-06 14:02:08 +0000 | [diff] [blame] | 62 | rm -rf jdk* primordial-jdk* build* out |
Stuart Monteith | 239e763 | 2019-02-08 10:15:08 +0000 | [diff] [blame] | 63 | mkdir -p build-stage1 build-stage2 out |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 64 | |
Stuart Monteith | 05af87b | 2019-01-21 21:59:25 +0000 | [diff] [blame] | 65 | cd $HOME/srv/jdk-cache/jdk10 |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 66 | export JAVA_HOME=${PWD} |
| 67 | |
| 68 | export PATH=${JAVA_HOME}/bin:${PATH} |
| 69 | |
| 70 | cd ${WORKSPACE} |
| 71 | |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 72 | # Extract sources from upstream job |
Stuart Monteith | 17cf7ee | 2018-11-12 10:14:24 +0000 | [diff] [blame] | 73 | tar xaf incoming/jdk11u.tar.gz |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 74 | |
Stuart Monteith | 17cf7ee | 2018-11-12 10:14:24 +0000 | [diff] [blame] | 75 | mv jdk11u $JDK_SRCDIR |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 76 | # Tar up the source before sullying it with a build. |
Stuart Monteith | 17cf7ee | 2018-11-12 10:14:24 +0000 | [diff] [blame] | 77 | tar --exclude=.hg\* -acf out/jdk11u-src-${RELEASE}.tar.xz $JDK_SRCDIR |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 78 | |
| 79 | mv $JDK_SRCDIR $JDKDIR |
| 80 | shopt -s nullglob |
| 81 | |
Stuart Monteith | 571d52b | 2019-02-06 14:02:08 +0000 | [diff] [blame] | 82 | # Configure and build. |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 83 | two_stage_build=0 |
| 84 | |
| 85 | which java |
| 86 | java -version |
| 87 | |
| 88 | if [ $two_stage_build = 1 ]; then |
| 89 | pushd build-stage1 |
Stuart Monteith | 087485e | 2018-10-16 16:25:21 +0100 | [diff] [blame] | 90 | sh ../$JDKDIR/configure --with-debug-level=${BUILD_TYPE} --with-boot-jdk=${WORKSPACE}/primordial-jdk11 ${ccache_build_opts} |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 91 | make images |
| 92 | popd |
| 93 | |
| 94 | pushd build-stage2 |
Stuart Monteith | 087485e | 2018-10-16 16:25:21 +0100 | [diff] [blame] | 95 | sh ../$JDKDIR/configure --with-debug-level=${BUILD_TYPE} \ |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 96 | --with-boot-jdk=${WORKSPACE}/build-stage1/images/jdk \ |
| 97 | ${ccache_build_opts} \ |
| 98 | --with-version-opt="Linaro-$RELEASE" \ |
Stuart Monteith | 6e2a175 | 2018-12-10 10:01:13 +0000 | [diff] [blame] | 99 | --with-version-pre="release" \ |
| 100 | --disable-warnings-as-errors |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 101 | make images |
| 102 | popd |
| 103 | else |
| 104 | pushd build-stage2 |
Stuart Monteith | 087485e | 2018-10-16 16:25:21 +0100 | [diff] [blame] | 105 | sh ../$JDKDIR/configure --with-debug-level=${BUILD_TYPE} \ |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 106 | ${ccache_build_opts} \ |
| 107 | --with-version-opt="Linaro-$RELEASE" \ |
Stuart Monteith | 6e2a175 | 2018-12-10 10:01:13 +0000 | [diff] [blame] | 108 | --with-version-pre="release" \ |
| 109 | --disable-warnings-as-errors |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 110 | make images |
| 111 | popd |
| 112 | fi |
| 113 | |
| 114 | # Archive the result |
Stuart Monteith | 17cf7ee | 2018-11-12 10:14:24 +0000 | [diff] [blame] | 115 | artifact_name=jdk11u-${BUILD_TYPE}-${RELEASE} |
Stuart Monteith | 6016be5 | 2018-04-20 14:23:20 +0100 | [diff] [blame] | 116 | |
| 117 | # This is different from ordinary builds. |
| 118 | tar -C build-stage2/images --exclude=\*.debuginfo --transform="s!^jdk!$artifact_name!" -acf out/${artifact_name}.tar.xz jdk |
| 119 | publishers: |
| 120 | - archive: |
| 121 | artifacts: 'out/*.tar.xz' |
| 122 | - email: |
| 123 | recipients: 'stuart.monteith@linaro.org fathi.boudra@linaro.org' |