-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·51 lines (42 loc) · 1003 Bytes
/
update.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
#!/bin/bash
cd /srv/sploon-bpg
# update repo and discard changes
git stash
git checkout release
git branch --set-upstream-to=origin/release release
git pull
cat >config.toml <<EOF
java_8_home = ""
java_16_home = ""
java_17_home = ""
java_21_home = ""
EOF
if [[ ! -d "work/.git" ]]; then
mkdir -p work
cd work
chown -R radsteve .
git init .
git remote add origin https://github.com/SploonMC/patches.git
cd ..
fi
cd work
git pull origin master
cd ..
# check if docker container exists
if docker container inspect sploon-bin-patch-gen > /dev/null 2>&1; then
# if it does, check if it's running
if [ "$(docker container inspect -f '{{.State.Status}}' sploon-bin-patch-gen)" != "running" ]; then
docker compose down
docker compose up gen
cd work || exit 1
git add .
git commit -am "automated update"
git push -u origin master
fi
else
docker compose up gen
cd work || exit 1
git add .
git commit -am "automated update"
git push -u origin master
fi