-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use docker compose to build and start the app and then verify that it started.
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Build & test | ||
on: [push] | ||
jobs: | ||
build: | ||
name: Build and verify stack | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup environment | ||
run: | | ||
cp .env-example .env | ||
- name: Build and start the stack | ||
run: | | ||
docker-compose up --build -d | ||
- name: Verify that the stack is running | ||
run: | | ||
bash ci-verify.sh | ||
if [ $? -ne 0 ]; then | ||
docker compose logs | ||
exit 1 | ||
fi | ||
shell: bash |
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,20 @@ | ||
SUCCESS=0 | ||
|
||
for try in {1..3}; do | ||
status_code=$(curl --write-out %{http_code} --silent --output /dev/null http://localhost:3000) | ||
if [[ "$status_code" -eq 200 ]] ; then | ||
SUCCESS=1 | ||
break | ||
else | ||
echo "Attempt $try failed with status code $status_code" | ||
fi | ||
sleep 10 | ||
done | ||
|
||
if [[ "$SUCCESS" -eq 1 ]] ; then | ||
echo "Stack seems to be working 🎉" | ||
exit 0 | ||
else | ||
echo "Stack is not working 😭" | ||
exit 1 | ||
fi |