2023-02-12 03:41:04 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -o errexit
|
|
|
|
set -o pipefail
|
|
|
|
|
2023-02-12 23:50:26 +01:00
|
|
|
finish() {
|
2023-05-23 03:56:44 +02:00
|
|
|
# shellcheck disable=SC2317
|
2023-02-12 23:50:26 +01:00
|
|
|
kill_with_kids "$BROWSERSTACK_PID"
|
2023-05-23 03:56:44 +02:00
|
|
|
# shellcheck disable=SC2317
|
2023-02-12 23:50:26 +01:00
|
|
|
kill_with_kids "$STREAM_PID"
|
|
|
|
}
|
|
|
|
|
2023-02-12 03:41:04 +01:00
|
|
|
rm -rf ./screenshots
|
|
|
|
mkdir -p ./screenshots
|
|
|
|
|
|
|
|
curl -o ./BrowserStackLocal-linux-x64.zip https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip
|
|
|
|
unzip -o ./BrowserStackLocal-linux-x64.zip
|
2023-02-12 03:59:11 +01:00
|
|
|
./BrowserStackLocal --key "$BROWSERSTACK_KEY" &
|
2023-02-12 23:50:26 +01:00
|
|
|
BROWSERSTACK_PID=$!
|
2023-02-12 03:41:04 +01:00
|
|
|
|
|
|
|
trap finish EXIT TERM INT
|
|
|
|
|
|
|
|
npm install --silent >/dev/null
|
|
|
|
source ../tools.sh
|
|
|
|
install_ffmpeg
|
|
|
|
start_owncast
|
|
|
|
|
|
|
|
# Offline screenshots
|
|
|
|
FILE_SUFFIX="offline" node index.js
|
|
|
|
|
|
|
|
# Online screenshots
|
|
|
|
start_stream
|
|
|
|
sleep 20
|
|
|
|
|
|
|
|
FILE_SUFFIX="online" node index.js
|
|
|
|
|
|
|
|
SCREENSHOTS="$(pwd)/screenshots"
|
2023-02-12 03:59:11 +01:00
|
|
|
echo "$SCREENSHOTS"
|
2023-02-12 03:41:04 +01:00
|
|
|
|
|
|
|
# Change to the root directory of the repository
|
|
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
|
|
|
|
|
|
cd web/.storybook/story-assets
|
|
|
|
rm -rf ./screenshots
|
|
|
|
mv "$SCREENSHOTS" .
|