-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from isel-leic-daw/feature/main/use-docker-compose
gh-2: adds docker compose to the github action tests
- Loading branch information
Showing
4 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
code/tic-tac-tow-service/tests/scripts/wait-for-postgres.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
# wait-for-postgres.sh host cmd | ||
|
||
set -e | ||
|
||
host="$1" | ||
shift | ||
cmd="$@" | ||
|
||
>&2 echo "waiting for postgres on $host" | ||
until pg_isready -h $host; do | ||
>&2 echo "Postgres is unavailable - sleeping" | ||
sleep 1 | ||
done | ||
|
||
>&2 echo "Postgres is up - executing command '$cmd'" | ||
exec $cmd |