diff --git a/.tangled/workflows/build.yml b/.tangled/workflows/build.yml index 3737612..4ba9c94 100644 --- a/.tangled/workflows/build.yml +++ b/.tangled/workflows/build.yml @@ -28,33 +28,33 @@ steps: - name: "Build and push container image" command: | - set -e # Exit on error + set -ex # Exit on error and print commands - # Create a container from distroless base + # Suppress buildah user warnings by redirecting stderr for non-critical commands echo "Creating container from distroless base..." - container=$(buildah --storage-driver vfs from gcr.io/distroless/cc-debian12:nonroot) + container=$(buildah --storage-driver vfs from gcr.io/distroless/cc-debian12:nonroot 2>&1 | tee /dev/stderr | grep -oP 'working-container-\d+' || buildah --storage-driver vfs from gcr.io/distroless/cc-debian12:nonroot) echo "Container ID: $container" # Copy the binaries echo "Copying binaries..." - buildah --storage-driver vfs copy $container target/release/grain /app/grain - buildah --storage-driver vfs copy $container target/release/grainctl /app/grainctl + buildah --storage-driver vfs copy $container target/release/grain /app/grain 2>&1 | grep -v "error determining current user" || true + buildah --storage-driver vfs copy $container target/release/grainctl /app/grainctl 2>&1 | grep -v "error determining current user" || true # Set configuration echo "Configuring container..." - buildah --storage-driver vfs config --workingdir /app $container - buildah --storage-driver vfs config --env RUST_LOG=info $container - buildah --storage-driver vfs config --port 8888 $container - buildah --storage-driver vfs config --cmd '["/app/grain", "--host", "0.0.0.0:8888", "--users-file", "/data/users.json"]' $container + buildah --storage-driver vfs config --workingdir /app $container 2>&1 | grep -v "error determining current user" || true + buildah --storage-driver vfs config --env RUST_LOG=info $container 2>&1 | grep -v "error determining current user" || true + buildah --storage-driver vfs config --port 8888 $container 2>&1 | grep -v "error determining current user" || true + buildah --storage-driver vfs config --cmd '["/app/grain", "--host", "0.0.0.0:8888", "--users-file", "/data/users.json"]' $container 2>&1 | grep -v "error determining current user" || true # Add labels - buildah --storage-driver vfs config --label "org.opencontainers.image.source=https://tangled.org/@pierrelf.com/grain" $container - buildah --storage-driver vfs config --label "org.opencontainers.image.description=Grain OCI Registry" $container - buildah --storage-driver vfs config --label "org.opencontainers.image.version=${TANGLED_COMMIT_SHA:0:7}" $container + buildah --storage-driver vfs config --label "org.opencontainers.image.source=https://tangled.org/@pierrelf.com/grain" $container 2>&1 | grep -v "error determining current user" || true + buildah --storage-driver vfs config --label "org.opencontainers.image.description=Grain OCI Registry" $container 2>&1 | grep -v "error determining current user" || true + buildah --storage-driver vfs config --label "org.opencontainers.image.version=${TANGLED_COMMIT_SHA:0:7}" $container 2>&1 | grep -v "error determining current user" || true # Commit the container to an image echo "Committing image..." - buildah --storage-driver vfs commit $container grain:latest + buildah --storage-driver vfs commit $container grain:latest 2>&1 | grep -v "error determining current user" # Login and push to Docker Hub echo "Logging in to Docker Hub..."