From 2284f202070aa2e49156cc52b3b1596a7d5aadec Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 29 Jul 2019 11:59:29 +0200 Subject: Add gitlab ci support --- scripts/nightly.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 scripts/nightly.sh (limited to 'scripts/nightly.sh') 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 @@ +#!/bin/bash + +set -eu + +shutdown() { + # Get our process group id + # shellcheck disable=SC2009 + PGID=$(ps -o pgid= $$ | grep -o "[0-9]*") + + # Kill it in a new new process group + setsid kill -- -"$PGID" + exit 0 +} + +trap "shutdown" SIGINT SIGTERM + +today=$(date '+%F') +directory_name="peertube-nightly-$today" +tar_name="peertube-nightly-$today.tar.xz" + +npm run build + +# Creating the archives +( + # local variables + directories_to_archive=("$directory_name/CREDITS.md" "$directory_name/FAQ.md" \ + "$directory_name/LICENSE" "$directory_name/README.md" \ + "$directory_name/client/dist/" "$directory_name/client/yarn.lock" \ + "$directory_name/client/package.json" "$directory_name/config" \ + "$directory_name/dist" "$directory_name/package.json" \ + "$directory_name/scripts" "$directory_name/support" \ + "$directory_name/tsconfig.json" "$directory_name/yarn.lock") + + # temporary setup + cd .. + ln -s "PeerTube" "$directory_name" + + XZ_OPT=-e9 tar cfJ "PeerTube/$tar_name" "${directories_to_archive[@]}" + + # temporary setup destruction + rm "$directory_name" +) -- cgit v1.2.3