update publish process
This commit is contained in:
parent
b3ad8f2b0a
commit
86eba2506a
@ -31,5 +31,6 @@ tasks:
|
|||||||
# - sudo --preserve-env is required to pass environment variables
|
# - sudo --preserve-env is required to pass environment variables
|
||||||
- publish: |
|
- publish: |
|
||||||
cd alpine-cli
|
cd alpine-cli
|
||||||
chpst -e ~/.envdir sudo --preserve-env just publish
|
chpst -e ~/.envdir sudo --preserve-env just registry_pass_var=GH_PAT publish
|
||||||
chpst -e ~/.envdir sudo --preserve-env just publish-dh
|
chpst -e ~/.envdir sudo --preserve-env just registry=docker.io registry_pass_var=DH_PAT publish
|
||||||
|
chpst -e ~/.envdir sudo --preserve-env just registry=quay.io registry_pass_var=QUAY_PAT publish
|
||||||
|
|||||||
21
justfile
21
justfile
@ -2,21 +2,20 @@ set dotenv-load
|
|||||||
|
|
||||||
image := "jswank/alpine-cli:latest"
|
image := "jswank/alpine-cli:latest"
|
||||||
|
|
||||||
|
registry := "ghcr.io"
|
||||||
|
registry_user := "jswank"
|
||||||
|
|
||||||
|
# this environment variable will be passed to podman login as the password
|
||||||
|
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}} -f Dockerfile ctx
|
||||||
|
|
||||||
# publish the image
|
# publish the image
|
||||||
publish:
|
publish:
|
||||||
@ podman tag {{image}} ghcr.io/{{image}}
|
@ podman tag {{image}} {{registry}}/{{image}}
|
||||||
@ echo $GH_PAT | podman login ghcr.io -u jswank --password-stdin >/dev/null 2>&1
|
@ echo "${{ registry_pass_var }}" | podman login {{registry}} -u {{registry_user}} --password-stdin
|
||||||
podman push ghcr.io/{{image}}
|
@ podman push {{registry}}/{{image}}
|
||||||
@ podman logout ghcr.io
|
@ podman logout {{registry}}
|
||||||
|
|
||||||
# publish the image to Dockerhub / docker.io
|
|
||||||
publish-dh:
|
|
||||||
@ podman tag {{image}} docker.io/{{image}}
|
|
||||||
@ echo $DH_PAT | podman login docker.io -u jswank --password-stdin >/dev/null 2>&1
|
|
||||||
podman push docker.io/{{image}}
|
|
||||||
@ podman logout docker.io
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user