-
Notifications
You must be signed in to change notification settings - Fork 263
/
release_batch.sh
executable file
·59 lines (51 loc) · 1.45 KB
/
release_batch.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
printf "Creating installation package\n"
printf "Checklist:\n"
printf "* Angular Admin Version Check. \n"
printf "* Janusec Version Check. \n"
version="1.5.1"
printf "Version: ${version} \n"
read -r -p "Are You Sure? [Y/n] " option
case $option in
[yY]) printf "Continue \n"
;;
[nN]) printf "Bye! \n"
exit 0
;;
*) printf "Invalid option. \n"
exit 1
;;
esac
function buildFor() {
filename_prefix="janusec-${version}-$1"
temp_dir="./dist/${filename_prefix}/"
mkdir -p ${temp_dir}
\cp -f ./janusec ${temp_dir}
\cp -f ./3rdpartylicenses.txt ${temp_dir}
rm -rf ${temp_dir}static
mkdir ${temp_dir}static
\cp -r ./static/janusec-admin ${temp_dir}static/
\cp -r ./static/welcome ${temp_dir}static/
\cp -f ./robots.txt ${temp_dir}static/
\cp -f ./scripts/* ${temp_dir}
cd ./dist/
tar -zcf ./${filename_prefix}.tar.gz ./${filename_prefix}
rm -rf ./${filename_prefix}
cd ..
}
printf "Building amd64 ... \n"
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build janusec.go
buildFor amd64
printf "amd64 done!\n"
printf "Building arm64 ... \n"
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build janusec.go
buildFor arm64
printf "arm64 done!\n"
#printf "Building mips64 ... \n"
#CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build janusec.go
#buildFor mips64
#printf "mips64 done!\n"
#printf "Building mips64le ... \n"
#CGO_ENABLED=0 GOOS=linux GOARCH=mips64le go build janusec.go
#buildFor mips64le
#printf "mips64le done!\n"
printf "Done!\n"