-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate-yaml-dev.sh
executable file
·94 lines (90 loc) · 2.71 KB
/
generate-yaml-dev.sh
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh
set -e
FILE="esl-1.0.0.jar"
if test -f "$FILE"; then
echo "$FILE already exists; using that."
else
echo "Please download the jar file from '<location of your esl jar which developers can download from>'"
exit 1
fi
if [ "$SERVICE" = "" ]; then
echo "Please set environment variable 'SERVICE' to the directory of 'environments.esl'"
exit 1
else
echo "Processing $SERVICE"
fi
REPO=https://repo.maven.apache.org/maven2
mkdir -p lib
cd lib
if [ ! -f "groovy-4.0.10.jar" ]; then
curl -O $REPO/org/apache/groovy/groovy/4.0.10/groovy-4.0.10.jar
fi
if [ ! -f "groovy-json-4.0.10.jar" ]; then
curl -O $REPO/org/apache/groovy/groovy-json/4.0.10/groovy-json-4.0.10.jar
fi
if [ ! -f "groovy-yaml-4.0.10.jar" ]; then
curl -O $REPO/org/apache/groovy/groovy-yaml/4.0.10/groovy-yaml-4.0.10.jar
fi
if [ ! -f "slf4j-api-1.7.30.jar" ]; then
curl -O $REPO/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar
fi
if [ ! -f "jackson-annotations-2.14.2.jar" ]; then
curl -O $REPO/com/fasterxml/jackson/core/jackson-annotations/2.14.2/jackson-annotations-2.14.2.jar
fi
if [ ! -f "jackson-core-2.14.2.jar" ]; then
curl -O $REPO/com/fasterxml/jackson/core/jackson-core/2.14.2/jackson-core-2.14.2.jar
fi
if [ ! -f "jackson-databind-2.14.2.jar" ]; then
curl -O $REPO/com/fasterxml/jackson/core/jackson-databind/2.14.2/jackson-databind-2.14.2.jar
fi
if [ ! -f "jackson-dataformat-yaml-2.14.2.jar" ]; then
curl -O $REPO/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.14.2/jackson-dataformat-yaml-2.14.2.jar
fi
if [ ! -f "snakeyaml-1.33.jar" ]; then
curl -O $REPO/org/yaml/snakeyaml/1.33/snakeyaml-1.33.jar
fi
cd ..
ARCH=$(arch)
OS=$(uname -s)
java_exists=0
mvn_exists=0
check_java_installed() {
exists=$(java --version)
java_exists=$?
echo "Using $(which java)"
}
install_java() {
check_java_installed
if [ "$java_exists" = "0" ]; then
return
fi
if [ "$ARCH" = "x86_64" ]; then
ARCH="x64"
fi
if [ "$OS" = "Linux" ]; then
OS="linux"
fi
if [ "$OS" = "Darwin" ]; then
OS="macos"
if [ "$ARCH" = "arm64" ]; then
ARCH="aarch64"
fi
fi
FILE="jdk-17_${OS}-${ARCH}_bin.tar.gz"
if test -f "$FILE"; then
echo "$FILE exists."
else
echo "Downloading JDK"
wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" "https://download.oracle.com/java/17/latest/$FILE"
tar -xvzf $FILE
fi
if [ "$OS" = "macos" ]; then
export JAVA_HOME="$(pwd)/jdk-17.0.9.jdk/Contents/Home"
else
export JAVA_HOME="$(pwd)/jdk-17.0.9"
fi
echo "JAVA_HOME: $JAVA_HOME"
export PATH=$JAVA_HOME/bin:$PATH
}
install_java
java -cp lib -cp esl-1.0.0.jar com.cashfree.esl.Main $@