forked from malikzh/NCANode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_release.sh
executable file
·52 lines (45 loc) · 1.76 KB
/
build_release.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
#!/usr/bin/env bash
#
# Build script for CI
#
if [ "$1" == "" ]; then
echo "Version not specified"
exit
fi
RELEASE_DIR="release_v${1}"
NCANODE_ORIGINAL_JAR="./target/ncanode-jar-with-dependencies.jar"
if [ ! -f "$NCANODE_ORIGINAL_JAR" ]; then
echo "Release $NCANODE_ORIGINAL_JAR not exists"
exit
fi
mkdir $RELEASE_DIR && \
cp $NCANODE_ORIGINAL_JAR "$RELEASE_DIR/NCANode.jar" && \
cp "./NCANode.bat" "$RELEASE_DIR" && \
cp "./NCANode.sh" "$RELEASE_DIR" && \
chmod +x "$RELEASE_DIR/NCANode.sh" && \
cp "./NCANode.ini" "$RELEASE_DIR" && \
cp "./NCANode.postman_collection.json" "$RELEASE_DIR" && \
cp "./NCANode_2.0.postman_collection.json" "$RELEASE_DIR" && \
cp "./README.md" "$RELEASE_DIR" && \
cp "./LICENSE" "$RELEASE_DIR" && \
cp -r "./docs" "$RELEASE_DIR" && \
mkdir -p "$RELEASE_DIR/ca/root" && \
mkdir -p "$RELEASE_DIR/ca/trusted" && \
mkdir -p "$RELEASE_DIR/cache/crl" && \
mkdir "$RELEASE_DIR/logs" && \
touch "$RELEASE_DIR/logs/error.log" && \
touch "$RELEASE_DIR/logs/request.log" && \
curl -k -L -o "$RELEASE_DIR/ca/root/root_rsa.crt" https://pki.gov.kz/cert/root_rsa.crt && \
curl -k -L -o "$RELEASE_DIR/ca/root/root_gost.crt" https://pki.gov.kz/cert/root_gost.crt && \
curl -k -L -o "$RELEASE_DIR/ca/trusted/pki_rsa.crt" https://pki.gov.kz/cert/pki_rsa.crt && \
curl -k -L -o "$RELEASE_DIR/ca/trusted/pki_gost.crt" https://pki.gov.kz/cert/pki_gost.crt && \
curl -k -L -o "$RELEASE_DIR/ca/trusted/nca_rsa.crt" https://pki.gov.kz/cert/nca_rsa.crt && \
curl -k -L -o "$RELEASE_DIR/ca/trusted/nca_gost.crt" https://pki.gov.kz/cert/nca_gost.crt && \
cd "$RELEASE_DIR" && \
zip "../NCANode.zip" -r . && \
tar cvzf "../NCANode.tar.gz" . && \
cd .. && \
rm -r "$RELEASE_DIR"
md5sum "NCANode.zip" "NCANode.tar.gz"
sha1sum "NCANode.zip" "NCANode.tar.gz"
echo "Build OK"