blob: 858ff575a315af065e263df7fbd5e6119aabaf3e [file] [log] [blame]
Jeff Gastonbbeda2d2020-05-26 13:14:15 -04001#!/bin/bash -ev
Jeff Gaston4731db32020-05-06 15:09:54 -04002
3# Updates prebuilts/jdk/jdk11 from build server.
4# Usage:
Jeff Gastonbbeda2d2020-05-26 13:14:15 -04005# $ cd <REPO>
Jeff Gaston4731db32020-05-06 15:09:54 -04006# $ repo start jdk11_update .
Jeff Gastonbbeda2d2020-05-26 13:14:15 -04007# $ prebuilts/jdk/jdk11/update-jdk11.sh <BUILD_NUMBER>
Jeff Gaston4731db32020-05-06 15:09:54 -04008# $ repo upload --cbr .
9
10
11BUILD_NUMBER="${1:?Specify build number}"
12LINUX_ZIP=/tmp/$$.linux.zip
13DARWIN_ZIP=/tmp/$$.darwin.zip
14
15FETCH_ARTIFACT=/google/data/ro/projects/android/fetch_artifact
Jeff Gastonbbeda2d2020-05-26 13:14:15 -040016cd "$(dirname $0)"
Jeff Gaston4731db32020-05-06 15:09:54 -040017
18rm -rf staging
19mkdir -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
25rm -rf staging/linux-x86
26mkdir -p staging/linux-x86
27(cd staging/linux-x86; unzip -q ${LINUX_ZIP})
28touch staging/linux-x86/MODULE_LICENSE_GPL
29
30rm -rf staging/darwin-x86
31mkdir staging/darwin-x86
32(cd staging/darwin-x86; unzip -q ${DARWIN_ZIP})
33touch staging/darwin-x86/MODULE_LICENSE_GPL
34
35rm -f ${LINUX_ZIP} ${DARWIN_ZIP}
36
37version=$(staging/linux-x86/bin/java -version 2>&1 | grep "OpenJDK Runtime Environment" | sed -e 's/.*(\(.*\))/\1/')
38
39# Commit to staging
40git add staging
41git commit -m "Add JDK ${version} to staging
42
43Test: none"
44
45git rm -rf linux-x86 darwin-x86 manifest.xml
46git mv staging/* .
Jeff Gastonbbeda2d2020-05-26 13:14:15 -040047rmdir staging
Jeff Gaston4731db32020-05-06 15:09:54 -040048git commit -m "Switch to JDK $version" --edit