Files
team/e2e-tests/.ci/dashboard.entrypoint.sh
e1453d0eeb MM-52642 CLD-6352 MM-54007 Prepare setup for Playwright pipeline (#24647)
* pipeline(playwright): prepare setup for playwright

* feedback address

* clean up readme

* Fix docker-compose command and definition for dashboard

* fix the dashboard

* ignore dashboard when formatting

---------

Co-authored-by: Mattermost Build <[email protected]>
Co-authored-by: Mario Vitale <[email protected]>
2023-10-14 07:02:32 +08:00

22 lines
590 B
Bash
Executable File

#!/bin/bash
set -e -u -o pipefail
npm install
# Run migrations. This is also a way to wait for the database to be up
MIGRATION_ATTEMPTS_LEFT=10
MIGRATION_ATTEMPTS_INTERVAL=10
until npm run migrate:latest; do
MIGRATION_ATTEMPTS_LEFT=$((MIGRATION_ATTEMPTS_LEFT - 1))
[ "$MIGRATION_ATTEMPTS_LEFT" -gt 0 ] || break
echo "Migration script failed, sleeping $MIGRATION_ATTEMPTS_INTERVAL"
sleep $MIGRATION_ATTEMPTS_INTERVAL
done
[ "$MIGRATION_ATTEMPTS_LEFT" -gt 0 ] || {
echo "Migration script failed, exhausted attempts. Giving up."
exit 1
}
# Launch the dashboard
exec npm run dev