aboutsummaryrefslogtreecommitdiff
path: root/justfile
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-18 07:52:13 +0000
committerFuwn <[email protected]>2026-02-18 07:52:13 +0000
commitd645b9f595a9fc2c680c825c15a5efb4c35c4969 (patch)
tree26918a55df1baa11776c08364a3cac794a45aa90 /justfile
parentfeat(response): Add input/sensitive-input handling (diff)
downloadseptember-d645b9f595a9fc2c680c825c15a5efb4c35c4969.tar.xz
september-d645b9f595a9fc2c680c825c15a5efb4c35c4969.zip
build: Switch from Earthly to Dockerfile
Diffstat (limited to 'justfile')
-rw-r--r--justfile28
1 files changed, 28 insertions, 0 deletions
diff --git a/justfile b/justfile
index 93371e8..ebf04bb 100644
--- a/justfile
+++ b/justfile
@@ -2,6 +2,11 @@ import? 'cargo.just'
set allow-duplicate-recipes := true
+name := "september"
+ghcr_repo := "ghcr.io/gemrest/" + name
+gitlab_repo := "registry.gitlab.com/gemrest/" + name
+docker_hub_repo := "docker.io/gemrest/" + name
+
default:
@just --list
@@ -10,3 +15,26 @@ fetch:
fmt:
cargo +nightly fmt
+
+# Build once, then push both `latest` and the latest git tag to all registries.
+publish-images:
+ #!/usr/bin/env bash
+
+ set -euo pipefail
+
+ git_tag="$(git describe --tags --abbrev=0)"
+ docker_tag="${git_tag#v}"
+
+ docker build --platform linux/amd64 -f Dockerfile -t {{name}}:build .
+
+ for registry in {{ghcr_repo}} {{gitlab_repo}} {{docker_hub_repo}}; do
+ docker tag {{name}}:build "$registry:latest"
+ docker tag {{name}}:build "$registry:$docker_tag"
+ done
+
+ docker push "{{ghcr_repo}}:latest"
+ docker push "{{ghcr_repo}}:$docker_tag"
+ docker push "{{gitlab_repo}}:latest"
+ docker push "{{gitlab_repo}}:$docker_tag"
+ docker push "{{docker_hub_repo}}:latest"
+ docker push "{{docker_hub_repo}}:$docker_tag"