diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-29 11:59:29 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-07-29 13:40:39 +0200 |
commit | 2284f202070aa2e49156cc52b3b1596a7d5aadec (patch) | |
tree | 77aeb00016734667f8ff32a98ea8b4a6ed3ca31e /scripts/nightly.sh | |
parent | 112be80ebdf96ef6a27420c1c6a10097388731a9 (diff) | |
download | PeerTube-2284f202070aa2e49156cc52b3b1596a7d5aadec.tar.gz PeerTube-2284f202070aa2e49156cc52b3b1596a7d5aadec.tar.zst PeerTube-2284f202070aa2e49156cc52b3b1596a7d5aadec.zip |
Add gitlab ci support
Diffstat (limited to 'scripts/nightly.sh')
-rwxr-xr-x | scripts/nightly.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/scripts/nightly.sh b/scripts/nightly.sh new file mode 100755 index 000000000..bde5d57b9 --- /dev/null +++ b/scripts/nightly.sh | |||
@@ -0,0 +1,42 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | set -eu | ||
4 | |||
5 | shutdown() { | ||
6 | # Get our process group id | ||
7 | # shellcheck disable=SC2009 | ||
8 | PGID=$(ps -o pgid= $$ | grep -o "[0-9]*") | ||
9 | |||
10 | # Kill it in a new new process group | ||
11 | setsid kill -- -"$PGID" | ||
12 | exit 0 | ||
13 | } | ||
14 | |||
15 | trap "shutdown" SIGINT SIGTERM | ||
16 | |||
17 | today=$(date '+%F') | ||
18 | directory_name="peertube-nightly-$today" | ||
19 | tar_name="peertube-nightly-$today.tar.xz" | ||
20 | |||
21 | npm run build | ||
22 | |||
23 | # Creating the archives | ||
24 | ( | ||
25 | # local variables | ||
26 | directories_to_archive=("$directory_name/CREDITS.md" "$directory_name/FAQ.md" \ | ||
27 | "$directory_name/LICENSE" "$directory_name/README.md" \ | ||
28 | "$directory_name/client/dist/" "$directory_name/client/yarn.lock" \ | ||
29 | "$directory_name/client/package.json" "$directory_name/config" \ | ||
30 | "$directory_name/dist" "$directory_name/package.json" \ | ||
31 | "$directory_name/scripts" "$directory_name/support" \ | ||
32 | "$directory_name/tsconfig.json" "$directory_name/yarn.lock") | ||
33 | |||
34 | # temporary setup | ||
35 | cd .. | ||
36 | ln -s "PeerTube" "$directory_name" | ||
37 | |||
38 | XZ_OPT=-e9 tar cfJ "PeerTube/$tar_name" "${directories_to_archive[@]}" | ||
39 | |||
40 | # temporary setup destruction | ||
41 | rm "$directory_name" | ||
42 | ) | ||