blog/scripts/upload-builder.sh

14 lines
401 B
Bash
Raw Normal View History

2024-06-27 00:17:01 +00:00
#!/usr/bin/env bash
set -euo pipefail
nix build .#docker-builder
IMAGE_NAME=$(docker load -q -i ./result | cut -d':' -f2,3 | xargs)
REMOTE_IMAGE_NAME="git.mzhang.io/michael/$IMAGE_NAME"
docker image tag "$IMAGE_NAME" "$REMOTE_IMAGE_NAME"
2024-06-27 00:47:02 +00:00
sed -i -E "s~(.*image: ).*blog-docker-builder:?.*~\1$REMOTE_IMAGE_NAME~" .woodpecker.yml
2024-06-27 01:29:52 +00:00
echo "Created $REMOTE_IMAGE_NAME"
2024-06-27 01:38:45 +00:00
docker push -q "$REMOTE_IMAGE_NAME"