-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c6271b
commit e272db5
Showing
9 changed files
with
114 additions
and
124 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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
APP_NAME=$1 | ||
TIMEOUT=${2:-60} # Default timeout is 60 seconds if not provided | ||
__service=$1 | ||
|
||
# Give service a chance to start, and also to go into "Restarting" status | ||
sleep "${TIMEOUT}" | ||
__containerID=$(docker-compose ps -q "${__service}") | ||
|
||
STATUS=$(docker-compose ps --services --filter "status=running" | grep "${APP_NAME}") | ||
__restart_count=$(docker inspect --format '{{ .RestartCount }}' "$__containerID") | ||
__running=$(docker inspect --format '{{ .State.Running }}' "$__containerID") | ||
|
||
if [ -n "$STATUS" ]; then | ||
echo "$APP_NAME is running." | ||
exit 0 | ||
if [ "$__running" != "true" ] || [ "$__restart_count" -gt 0 ]; then | ||
echo "$__service is either not running or continuously restarting" | ||
docker-compose ps "${__service}" | ||
docker-compose logs "${__service}" | ||
exit 1 | ||
else | ||
echo "$__service is running" | ||
docker-compose ps "${__service}" | ||
exit 0 | ||
fi | ||
|
||
echo "$APP_NAME is either not started or restarting" | ||
docker-compose ps | grep "${APP_NAME}" | ||
exit 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Test ethd | ||
run-name: Test ethd | ||
|
||
on: | ||
push: | ||
pull_request: | ||
types: [opened, synchronize, labeled, unlabeled] | ||
branches: [main] | ||
|
||
jobs: | ||
test-ethd: | ||
if: | | ||
contains(github.event.pull_request.labels.*.name, 'test-ethd') || | ||
contains(github.event.pull_request.labels.*.name, 'test-all') || | ||
github.event_name == 'push' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Expect | ||
run: sudo apt-get install -y expect | ||
- name: Test ethd config | ||
run: expect ./.github/test-ethd-config.exp |
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
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