blob: 4414715e7597349027b3dd238ad64106940c2ca2 [file] [log] [blame]
Jeff Gastonbbeda2d2020-05-26 13:14:15 -04001#!/bin/bash -ev
Jeff Gaston4731db32020-05-06 15:09:54 -04002
Rahul Ravikumar44f9ae42022-02-10 16:23:30 -08003# Updates prebuilts/jdk/jdk11 from build server. (ab/openjdk)
Jeff Gaston4731db32020-05-06 15:09:54 -04004# 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
Rahul Ravikumar44f9ae42022-02-10 16:23:30 -080014DARWIN_AARCH64_ZIP=/tmp/$$.darwin_aarch64.zip
Jeff Gaston4731db32020-05-06 15:09:54 -040015
16FETCH_ARTIFACT=/google/data/ro/projects/android/fetch_artifact
Jeff Gastonbbeda2d2020-05-26 13:14:15 -040017cd "$(dirname $0)"
Jeff Gaston4731db32020-05-06 15:09:54 -040018
19rm -rf staging
20mkdir -p staging
21
22$FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target linux_openjdk11 jdk.zip ${LINUX_ZIP}
23$FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target darwin_mac_openjdk11 jdk.zip ${DARWIN_ZIP}
Rahul Ravikumar44f9ae42022-02-10 16:23:30 -080024$FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target darwin_mac_jetbrainsruntime jdk.zip ${DARWIN_AARCH64_ZIP}
Jeff Gaston4731db32020-05-06 15:09:54 -040025$FETCH_ARTIFACT --bid ${BUILD_NUMBER} --disable_progressbar --target linux_openjdk11 manifest_${BUILD_NUMBER}.xml staging/manifest.xml
26
27rm -rf staging/linux-x86
28mkdir -p staging/linux-x86
29(cd staging/linux-x86; unzip -q ${LINUX_ZIP})
30touch staging/linux-x86/MODULE_LICENSE_GPL
31
32rm -rf staging/darwin-x86
33mkdir staging/darwin-x86
34(cd staging/darwin-x86; unzip -q ${DARWIN_ZIP})
35touch staging/darwin-x86/MODULE_LICENSE_GPL
36
Rahul Ravikumar44f9ae42022-02-10 16:23:30 -080037rm -rf staging/darwin-aarch64
38mkdir staging/darwin-aarch64
39(cd staging/darwin-aarch64; unzip -q ${DARWIN_AARCH64_ZIP})
40touch staging/darwin-x86/MODULE_LICENSE_GPL
41
42rm -f ${LINUX_ZIP} ${DARWIN_ZIP} ${DARWIN_AARCH64_ZIP}
Jeff Gaston4731db32020-05-06 15:09:54 -040043
Colin Crossa7fdd4a2021-12-17 20:41:38 -080044# Copy the RBE toolchain inputs files from the previous version to the staging
45# directory.
46cp linux-x86/bin/*_remote_toolchain_inputs staging/linux-x86/bin
47
Jeff Gaston4731db32020-05-06 15:09:54 -040048version=$(staging/linux-x86/bin/java -version 2>&1 | grep "OpenJDK Runtime Environment" | sed -e 's/.*(\(.*\))/\1/')
49
50# Commit to staging
51git add staging
52git commit -m "Add JDK ${version} to staging
53
54Test: none"
55
56git rm -rf linux-x86 darwin-x86 manifest.xml
57git mv staging/* .
Jeff Gastonbbeda2d2020-05-26 13:14:15 -040058rmdir staging
Jeff Gaston4731db32020-05-06 15:09:54 -040059git commit -m "Switch to JDK $version" --edit