aboutsummaryrefslogtreecommitdiff
path: root/justfile
blob: 6f0512e0969ec62ae1538143568d4dac6740cf36 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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 --platform linux/amd64 -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"