Jeff Gaston | bbeda2d | 2020-05-26 13:14:15 -0400 | [diff] [blame] | 1 | #!/bin/bash -ev |
Jeff Gaston | 4731db3 | 2020-05-06 15:09:54 -0400 | [diff] [blame] | 2 | |
| 3 | # Updates prebuilts/jdk/jdk11 from build server. |
| 4 | # Usage: |
Jeff Gaston | bbeda2d | 2020-05-26 13:14:15 -0400 | [diff] [blame] | 5 | # $ cd <REPO> |
Jeff Gaston | 4731db3 | 2020-05-06 15:09:54 -0400 | [diff] [blame] | 6 | # $ repo start jdk11_update . |
Jeff Gaston | bbeda2d | 2020-05-26 13:14:15 -0400 | [diff] [blame] | 7 | # $ prebuilts/jdk/jdk11/update-jdk11.sh <BUILD_NUMBER> |
Jeff Gaston | 4731db3 | 2020-05-06 15:09:54 -0400 | [diff] [blame] | 8 | # $ repo upload --cbr . |
| 9 | |
| 10 | |
| 11 | BUILD_NUMBER="${1:?Specify build number}" |
| 12 | LINUX_ZIP=/tmp/$$.linux.zip |
| 13 | DARWIN_ZIP=/tmp/$$.darwin.zip |
| 14 | |
| 15 | FETCH_ARTIFACT=/google/data/ro/projects/android/fetch_artifact |
Jeff Gaston | bbeda2d | 2020-05-26 13:14:15 -0400 | [diff] [blame] | 16 | cd "$(dirname $0)" |
Jeff Gaston | 4731db3 | 2020-05-06 15:09:54 -0400 | [diff] [blame] | 17 | |
| 18 | rm -rf staging |
| 19 | mkdir -p staging |
| 20 | |
| 21 | $FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target linux_openjdk11 jdk.zip ${LINUX_ZIP} |
| 22 | $FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target darwin_mac_openjdk11 jdk.zip ${DARWIN_ZIP} |
| 23 | $FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target linux_openjdk11 manifest_${BUILD_NUMBER}.xml staging/manifest.xml |
| 24 | |
| 25 | rm -rf staging/linux-x86 |
| 26 | mkdir -p staging/linux-x86 |
| 27 | (cd staging/linux-x86; unzip -q ${LINUX_ZIP}) |
| 28 | touch staging/linux-x86/MODULE_LICENSE_GPL |
| 29 | |
| 30 | rm -rf staging/darwin-x86 |
| 31 | mkdir staging/darwin-x86 |
| 32 | (cd staging/darwin-x86; unzip -q ${DARWIN_ZIP}) |
| 33 | touch staging/darwin-x86/MODULE_LICENSE_GPL |
| 34 | |
| 35 | rm -f ${LINUX_ZIP} ${DARWIN_ZIP} |
| 36 | |
Colin Cross | a7fdd4a | 2021-12-17 20:41:38 -0800 | [diff] [blame^] | 37 | # Copy the RBE toolchain inputs files from the previous version to the staging |
| 38 | # directory. |
| 39 | cp linux-x86/bin/*_remote_toolchain_inputs staging/linux-x86/bin |
| 40 | |
Jeff Gaston | 4731db3 | 2020-05-06 15:09:54 -0400 | [diff] [blame] | 41 | version=$(staging/linux-x86/bin/java -version 2>&1 | grep "OpenJDK Runtime Environment" | sed -e 's/.*(\(.*\))/\1/') |
| 42 | |
| 43 | # Commit to staging |
| 44 | git add staging |
| 45 | git commit -m "Add JDK ${version} to staging |
| 46 | |
| 47 | Test: none" |
| 48 | |
| 49 | git rm -rf linux-x86 darwin-x86 manifest.xml |
| 50 | git mv staging/* . |
Jeff Gaston | bbeda2d | 2020-05-26 13:14:15 -0400 | [diff] [blame] | 51 | rmdir staging |
Jeff Gaston | 4731db3 | 2020-05-06 15:09:54 -0400 | [diff] [blame] | 52 | git commit -m "Switch to JDK $version" --edit |