forked from r-arek/test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript2
executable file
·53 lines (46 loc) · 1.59 KB
/
script2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
set -o errexit
set -o xtrace
main() {
local url vendor version license jdk certlink
jdk="$1"
vendor="$2"
version=13
case "${TRAVIS_CPU_ARCH}" in
"s390x" | "ppc64le")
local JAVA_VERSION
JAVA_VERSION=13
sudo apt-get update -yqq
PACKAGE="adoptopenjdk-${JAVA_VERSION}-hotspot"
if ! dpkg -s "$PACKAGE" >/dev/null 2>&1; then
if dpkg-query -l adoptopenjdk* >/dev/null 2>&1; then
dpkg-query -l adoptopenjdk* | grep adoptopenjdk | awk '{print $2}' | xargs sudo dpkg -P
fi
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
sudo apt-get update -yqq
sudo apt-get -yqq --no-install-suggests --no-install-recommends install "$PACKAGE" || true
sudo update-java-alternatives -s "$PACKAGE"*
fi
;;
*)
local JAVA_VERSION
JAVA_VERSION=13
sudo apt-get update -yqq
if [[ "$JAVA_VERSION" == "8" ]]; then
JAVA_VERSION="1.8.0"
fi
PACKAGE="bellsoft-java${JAVA_VERSION}"
if ! dpkg -s "$PACKAGE" >/dev/null 2>&1; then
wget -qO - https://download.bell-sw.com/pki/GPG-KEY-bellsoft | sudo apt-key add -
sudo add-apt-repository 'deb [arch='$TRAVIS_CPU_ARCH'] https://apt.bell-sw.com/ stable main'
sudo apt-get update -yqq
sudo apt-get -yqq --no-install-suggests --no-install-recommends install "$PACKAGE" || true
export JAVA_HOME=/usr/lib/jvm/bellsoft-java${JAVA_VERSION}-${TRAVIS_CPU_ARCH}
export PATH="$JAVA_HOME/bin:$PATH"
sudo update-java-alternatives -s "$PACKAGE"*
fi
;;
esac
}
main "$@"