2023-03-16 12:24:23 +01:00
#!/usr/bin/env bash
2023-03-16 12:53:12 +01:00
set -euxo pipefail
2023-05-04 11:00:37 +02:00
2023-05-04 14:59:44 +02:00
nix run .#build-static
nix run .#build-container
2023-05-04 11:00:37 +02:00
2023-05-17 12:21:21 +02:00
if [[ ! -z $TAG && ! -z $DOCKER_AUTH ]]; then
2023-05-04 14:59:44 +02:00
# Configure Docker Auth
2023-05-04 15:40:24 +02:00
mkdir .docker
cat > .docker/config.json <<EOF
2023-05-04 14:59:44 +02:00
{"auths":{"https://index.docker.io/v1/":{"auth":"${DOCKER_AUTH}"}}}
EOF
2023-05-04 15:40:24 +02:00
export DOCKER_CONFIG=`pwd`/.docker/
2023-03-16 12:53:12 +01:00
2023-05-04 15:29:41 +02:00
# Hack to circumvent "initializing source docker-archive:docker/linux.386.tar.gz: creating temporary file: open /var/tmp/docker-tar1213702538: no such file or directory"
mkdir -p /var/tmp/
# Release
2023-05-04 14:59:44 +02:00
nix run .#publish-static
nix run .#publish-garage
nix run .#publish-docker-hub
fi