add support for alt tag

This commit is contained in:
Jason Swank 2023-05-08 22:20:12 -04:00
parent 7d0f7c03aa
commit f8b7e54c8f

View File

@ -1,7 +1,7 @@
set dotenv-load set dotenv-load
tag := `grep ^FROM Dockerfile | cut -d: -f2` tag := `grep ^FROM Dockerfile | cut -d: -f2`
image := "jswank/alpine-cli:" + tag image := "jswank/alpine-cli"
registry := "ghcr.io" registry := "ghcr.io"
registry_user := "jswank" registry_user := "jswank"
@ -11,12 +11,11 @@ registry_pass_var := "REGISTRY_PASSWORD"
# build a new image # build a new image
build: build:
podman build -t {{image}} -f Dockerfile ctx podman build -t {{image}}:{{tag}} -f Dockerfile ctx
# publish the image # publish the image
publish: publish alt_tag=tag:
@ podman tag {{image}} {{registry}}/{{image}} @ podman tag {{image}}:{{tag}} {{registry}}/{{image}}:{{alt_tag}}
@ echo "${{ registry_pass_var }}" | podman login {{registry}} -u {{registry_user}} --password-stdin @ 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}} @ podman logout {{registry}}