Skip to content

Commit

Permalink
while do
Browse files Browse the repository at this point in the history
  • Loading branch information
lemmav committed Nov 21, 2023
1 parent fca5b11 commit 2ce6674
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/self-hosted-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ jobs:
DOCKER_IMAGES=$(grep -oP '(?<=image: ")[^"]+' $FILE | sed -e "s/\${REPO}/$REPO/g ; s/\${DOCKER_IMAGE_PREFIX}/$DOCKER_IMAGE_PREFIX/g ; s/\${DOCKER_TAG}/$DOCKER_TAG/g" | tr '\n' ' ' )
IFS=" " read -a IMAGES <<< "$DOCKER_IMAGES"
docker network create -d bridge onlyoffice
for IMAGE in ${IMAGES[@]}; do
NEW_IMAGE=$(echo $IMAGE | sed -Ee "s/4testing-//; s/\.[0-9]+$//")
NEW_IMAGE_LATEST=$(echo $IMAGE | sed -Ee "s/4testing-//; s/$DOCKER_TAG/latest/")
sleep 30
docker-compose -f db.yml up -d
sleep 30
Expand All @@ -68,15 +70,18 @@ jobs:
docker-compose -f notify.yml up -d
for CONTAINER_NAME in db elasticsearch redis rabbitmq healthchecks migration-runner docspace notify; do
CONTAINER_ID=$(docker-compose -f ${CONTAINER_NAME}.yml ps -q ${CONTAINER_NAME})
CONTAINER_STATUS=$(docker inspect -f '{{.State.Status}}' $CONTAINER_ID)
if [ "$CONTAINER_STATUS" == "restarting" ] || [ "$CONTAINER_STATUS" == "exited" ]; then
echo "Error: $CONTAINER_NAME container is $CONTAINER_STATUS."
exit 1
else
echo "$CONTAINER_NAME container is running."
fi
CONTAINER_IDS=$(docker-compose -f ${CONTAINER_NAME}.yml ps -q --all)
for CONTAINER_ID in $CONTAINER_IDS; do
CONTAINER_STATUS=$(docker inspect -f '{{.State.Status}}' $CONTAINER_ID)
if [ "$CONTAINER_STATUS" == "restarting" ] || [ "$CONTAINER_STATUS" == "exited" ]; then
echo "Error: $CONTAINER_NAME container is $CONTAINER_STATUS."
exit 1
else
echo "$CONTAINER_NAME container is running."
fi
done
done
done
shell: bash

0 comments on commit 2ce6674

Please sign in to comment.