-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: test env files with containers in cicd
Signed-off-by: Mirko Mollik <mirkomollik@gmail.com>
- Loading branch information
Showing
12 changed files
with
97 additions
and
6 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
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
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,41 @@ | ||
#!/bin/bash | ||
# this script is used to test the .env.example files and if the containers can start healthy with the provided configuration. It does not execute tests. | ||
folders=("keycloak" "holder" "issuer" "verifier") | ||
|
||
for folder in "${folders[@]}"; do | ||
echo "Processing folder: $folder" | ||
cd $folder | ||
cp .env.example .env | ||
docker compose up -d | ||
echo "Waiting for containers to be healthy in $folder..." | ||
|
||
check_health() { | ||
containers=$(docker compose ps -q) | ||
for container in $containers; do | ||
health_status=$(docker inspect --format='{{.State.Health.Status}}' $container 2>/dev/null || echo "unhealthy") | ||
if [ "$health_status" != "healthy" ]; then | ||
return 1 | ||
fi | ||
done | ||
return 0 | ||
} | ||
|
||
for i in {1..4}; do | ||
if check_health; then | ||
echo "All containers in $folder are healthy." | ||
docker compose down | ||
break | ||
fi | ||
echo "Waiting for containers to be healthy in $folder... ($i/3)" | ||
sleep 5 | ||
done | ||
|
||
if ! check_health; then | ||
echo "Containers in $folder did not become healthy in time." | ||
exit 1 | ||
fi | ||
|
||
cd .. | ||
done | ||
|
||
echo "All containers in all folders are healthy." |
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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
FROM docker.io/nginx:stable-alpine | ||
|
||
# Install wget | ||
RUN apk --no-cache add wget | ||
|
||
COPY site/ /usr/share/nginx/html/ | ||
EXPOSE 80 | ||
CMD ["nginx", "-g", "daemon off;"] |