#!/usr/bin/env nix
#!nix develop ``.#ci`` --command just --justfile
docker_registry := "registry.fly.io/alanpearce-eu"
docker-tag := env("DOCKER_TAG", `date -u +%Y%m%d%H%M%S` + "-" + `git rev-parse --short HEAD`)
listen_address := env("SERVER_LISTEN_ADDRESS", "::1")
port := env("SERVER_PORT", "8080")
website_repo := env("SOURCE", "../website")
default:
@just --list --justfile {{ justfile() }} --unsorted
clean:
rm -fr public
check-links: (build-site "--compress=false")
hyperlink public --sources {{ website_repo }}
update-all:
nix flake update
go get -u
gomod2nix
build:
go build ./domain/content/builder/build
build-site *BUILD_FLAGS: build
SOURCE={{ website_repo }} ./build {{ BUILD_FLAGS }}
run: dev
dev:
systemfd -s http::{{ listen_address }}:{{ port }} -- modd
ci: check-links
cd *DEPLOY_FLAGS: && (deploy DEPLOY_FLAGS)
fly auth docker
deploy *DEPLOY_FLAGS:
fly deploy --image $(KO_DOCKER_REPO={{ docker_registry }} ko build --sbom none --bare --tags {{ docker-tag }} .) {{ DEPLOY_FLAGS }}
justfile (view raw)