aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/nightly.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/nightly.sh')
-rwxr-xr-xscripts/nightly.sh42
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
3set -eu
4
5shutdown() {
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
15trap "shutdown" SIGINT SIGTERM
16
17today=$(date '+%F')
18directory_name="peertube-nightly-$today"
19tar_name="peertube-nightly-$today.tar.xz"
20
21npm 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)