From f8b7e54c8fde0295b38179b2deea15da6f4a0247 Mon Sep 17 00:00:00 2001 From: Jason Swank Date: Mon, 8 May 2023 22:20:12 -0400 Subject: [PATCH 1/4] add support for alt tag --- justfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/justfile b/justfile index 940a62f..801f0f3 100644 --- a/justfile +++ b/justfile @@ -1,7 +1,7 @@ set dotenv-load tag := `grep ^FROM Dockerfile | cut -d: -f2` -image := "jswank/alpine-cli:" + tag +image := "jswank/alpine-cli" registry := "ghcr.io" registry_user := "jswank" @@ -11,12 +11,11 @@ registry_pass_var := "REGISTRY_PASSWORD" # build a new image build: - podman build -t {{image}} -f Dockerfile ctx + podman build -t {{image}}:{{tag}} -f Dockerfile ctx # publish the image -publish: - @ podman tag {{image}} {{registry}}/{{image}} +publish alt_tag=tag: + @ podman tag {{image}}:{{tag}} {{registry}}/{{image}}:{{alt_tag}} @ echo "${{ registry_pass_var }}" | podman login {{registry}} -u {{registry_user}} --password-stdin - @ podman push {{registry}}/{{image}} + @ podman push {{registry}}/{{image}}:{{alt_tag}} @ podman logout {{registry}} - From c30001ac8e0e43ed2fbb24c016457105697e8c10 Mon Sep 17 00:00:00 2001 From: Jason Swank Date: Tue, 16 May 2023 11:35:22 -0400 Subject: [PATCH 2/4] .build.yml: add git tag to sources --- .build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build.yml b/.build.yml index 7a0b6ce..c0ba52e 100644 --- a/.build.yml +++ b/.build.yml @@ -6,7 +6,7 @@ secrets: - 130adee5-3a8f-4035-8cad-e3d044be2961 sources: - - https://git.sr.ht/~jswank/alpine-cli + - https://git.sr.ht/~jswank/alpine-cli#edge packages: - podman From b46558b04ca528d57286d30518ed2c4b67a2cad7 Mon Sep 17 00:00:00 2001 From: Jason Swank Date: Tue, 16 May 2023 12:28:19 -0400 Subject: [PATCH 3/4] .build.yml: revert tag definition --- .build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build.yml b/.build.yml index c0ba52e..7a0b6ce 100644 --- a/.build.yml +++ b/.build.yml @@ -6,7 +6,7 @@ secrets: - 130adee5-3a8f-4035-8cad-e3d044be2961 sources: - - https://git.sr.ht/~jswank/alpine-cli#edge + - https://git.sr.ht/~jswank/alpine-cli packages: - podman From 7d3ed87a4f4682ef934b090e470240ad677ef05a Mon Sep 17 00:00:00 2001 From: Jason Swank Date: Tue, 16 May 2023 18:19:54 -0400 Subject: [PATCH 4/4] justfile: add support for build flags --- justfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index 801f0f3..b17b4ee 100644 --- a/justfile +++ b/justfile @@ -10,8 +10,8 @@ registry_user := "jswank" registry_pass_var := "REGISTRY_PASSWORD" # build a new image -build: - podman build -t {{image}}:{{tag}} -f Dockerfile ctx +build flags="": + podman build -t {{image}}:{{tag}} {{ flags }} -f Dockerfile ctx # publish the image publish alt_tag=tag: