diff options
Diffstat (limited to 'justfile')
| -rw-r--r-- | justfile | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/justfile b/justfile new file mode 100644 index 0000000..8f39114 --- /dev/null +++ b/justfile @@ -0,0 +1,27 @@ +set shell := ["bash", "-eu", "-o", "pipefail", "-c"] + +ghcr_repo := "ghcr.io/gemrest/locus" +gitlab_repo := "registry.gitlab.com/gemrest/locus" + +default: + just --list + +# Build once, then push both `latest` and `YYYY-MM-DD` tags to both registries. +publish-images: + #!/usr/bin/env bash + + set -euo pipefail + + date_tag="$(date -u +%Y-%m-%d)" + + docker build -f Dockerfile -t locus:build . + + for registry in {{ghcr_repo}} {{gitlab_repo}}; do + docker tag locus:build "$registry:latest" + docker tag locus:build "$registry:$date_tag" + done + + docker push "{{ghcr_repo}}:latest" + docker push "{{ghcr_repo}}:$date_tag" + docker push "{{gitlab_repo}}:latest" + docker push "{{gitlab_repo}}:$date_tag" |