]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - scripts/nightly.sh
Introduce accounts command
[github/Chocobozzz/PeerTube.git] / scripts / nightly.sh
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 -- --source-map
22
23 nightly_version="nightly-$today"
24 sed -i 's/"version": "\([^"]\+\)"/"version": "\1-'"$nightly_version"'"/' ./package.json
25
26 # Creating the archives
27 (
28 # local variables
29 directories_to_archive=("$directory_name/CREDITS.md" "$directory_name/FAQ.md" \
30 "$directory_name/LICENSE" "$directory_name/README.md" \
31 "$directory_name/client/dist/" "$directory_name/client/yarn.lock" \
32 "$directory_name/client/package.json" "$directory_name/config" \
33 "$directory_name/dist" "$directory_name/package.json" \
34 "$directory_name/scripts" "$directory_name/support" \
35 "$directory_name/tsconfig.json" "$directory_name/yarn.lock")
36
37 # temporary setup
38 cd ..
39 ln -s "PeerTube" "$directory_name"
40
41 XZ_OPT=-e9 tar cfJ "PeerTube/$tar_name" "${directories_to_archive[@]}"
42
43 # temporary setup destruction
44 rm "$directory_name"
45 )
46
47 git checkout -- ./package.json