forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(test): test running docker after build (DIYgod#8010)
* chore(test): test running docker after build * add test in the same step * add count times * workflow typo * add name when output * if then * test docker * use id * no tag * what is docker id * load single platform * do not test multi-arch for now * no load
- Loading branch information
1 parent
9968dbf
commit 47176b6
Showing
3 changed files
with
43 additions
and
19 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
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,31 @@ | ||
#!/bin/bash | ||
|
||
MAX_RETRIES=60 | ||
# Try running the docker and get the output | ||
# then try getting homepage in 3 mins | ||
|
||
docker run -d -p 1200:1200 rsshub:latest | ||
|
||
if [[ $? -ne 0 ]] | ||
then | ||
echo "failed to run docker" | ||
exit 1 | ||
fi | ||
|
||
RETRY=1 | ||
curl -m 10 localhost:1200 | ||
while [[ $? -ne 0 ]] && [[ $RETRY -lt $MAX_RETRIES ]]; do | ||
sleep 5 | ||
((RETRY++)) | ||
echo "RETRY: ${RETRY}" | ||
curl -m 10 localhost:1200 | ||
done | ||
|
||
if [[ $RETRY -gt $MAX_RETRIES ]] | ||
then | ||
echo "Unable to run, aborted" | ||
exit 1 | ||
else | ||
echo "Successfully acquire homepage, passing" | ||
exit 0 | ||
fi |