diff options
Diffstat (limited to 'justfile')
-rwxr-xr-x | justfile | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/justfile b/justfile index e4021c0..e347d98 100755 --- a/justfile +++ b/justfile @@ -2,7 +2,7 @@ fly-system := "x86_64-linux" fly-registry := "registry.fly.io/alanpearce-eu" -docker-tag := env_var_or_default("DOCKER_TAG", `git rev-parse HEAD`) +docker-tag := env_var_or_default("DOCKER_TAG", `date --utc +%Y%m%d%H%M%S` + "-" + `git rev-parse --short HEAD`) version := `sentry-cli releases propose-version` environment := "production" started-at := `date +%s` @@ -34,6 +34,17 @@ nix-build what: watch-server: (watch-flake "watchexec -r -i content -i templates go run ./cmd/server") +dev: + #!/usr/bin/env bash + set -euxo pipefail + tmp="$(mktemp -d -t website-XXXXXX)" || exit 1 + echo using temp directory $tmp + trap "{ echo cleaning up $tmp; rm -rf \"$tmp\"; }" EXIT + go build -o $tmp ./cmd/dev ./cmd/build ./cmd/server + "${tmp}/dev" --temp-dir "${tmp}" + +watch-dev: (watch-flake "watchexec -r -e go just dev") + docker-stream system=(arch() + "-linux"): @nix build --print-out-paths .#docker-stream-{{ system }} | sh @@ -45,18 +56,18 @@ docker-stream-fly: docker-image-fly: (docker-image fly-system) -docker-inspect image-path="result" *skopeo-flags="": - skopeo {{ skopeo-flags }} inspect docker-archive:{{ image-path }} +docker-inspect image-path="result": + skopeo inspect docker-archive:{{ image-path }} print-docker-tag: @echo {{ fly-registry }}:{{ docker-tag }} -stream-to-registry *skopeo-flags="": sentry-create-release && sentry-finalise-release - just docker-stream-fly | gzip --fast | skopeo {{ skopeo-flags }} copy --dest-precompute-digests docker-archive:/dev/stdin docker://{{ fly-registry }}:{{ docker-tag }} +stream-to-registry : sentry-create-release && sentry-finalise-release + just docker-stream-fly | gzip --fast | skopeo copy --dest-precompute-digests docker-archive:/dev/stdin docker://{{ fly-registry }}:{{ docker-tag }} result := `readlink -f result` -push-to-registry *skopeo-flags="": - skopeo {{ skopeo-flags }} copy --dest-precompute-digests docker-archive://{{ result }} docker://{{ fly-registry }}:{{ docker-tag }} +push-to-registry: sentry-create-release && sentry-finalise-release + skopeo copy --dest-precompute-digests docker-archive://{{ result }} docker://{{ fly-registry }}:{{ docker-tag }} sentry-create-release: sentry-cli releases new {{ version }} |