Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
Try capturing lengthy output *inside* the container
Browse files Browse the repository at this point in the history
  • Loading branch information
major committed Sep 14, 2023
1 parent 5a6e930 commit 0ac159e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ composer-cli() {

# Start the container.
echo "🚀 Launching the container"
mkdir -vp shared output
sudo podman run --rm --detach --privileged \
-v $(pwd)/shared:/repo \
-v $(pwd)/output:/output \
--name $CONTAINER_NAME \
$CONTAINER

Expand Down Expand Up @@ -54,11 +56,9 @@ sleep 10

COUNTER=0
while true; do
composer-cli --json compose info "${COMPOSE_ID}" | tee compose_info.json >/dev/null
composer-cli "--json compose info \"${COMPOSE_ID}\" | tee /output/compose_info.json >/dev/null"

# Sometimes tee isn't done writing by the time we check the status line below. 🐌
sleep 2
COMPOSE_STATUS=$(jq -r ".[].body.queue_status" compose_info.json)
COMPOSE_STATUS=$(jq -r ".[].body.queue_status" output/compose_info.json)

# Print a status line once per minute.
if [ $((COUNTER % 60)) -eq 0 ]; then
Expand Down

0 comments on commit 0ac159e

Please sign in to comment.