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
|
||||
- publish: |
|
||||
cd alpine-cli
|
||||
chpst -e ~/.envdir sudo --preserve-env just publish
|
||||
chpst -e ~/.envdir sudo --preserve-env just publish-dh
|
||||
chpst -e ~/.envdir sudo --preserve-env just registry_pass_var=GH_PAT publish
|
||||
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"
|
||||
|
||||
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:
|
||||
podman build -t {{image}} -f Dockerfile ctx
|
||||
|
||||
# publish the image
|
||||
publish:
|
||||
@ podman tag {{image}} ghcr.io/{{image}}
|
||||
@ echo $GH_PAT | podman login ghcr.io -u jswank --password-stdin >/dev/null 2>&1
|
||||
podman push ghcr.io/{{image}}
|
||||
@ podman logout ghcr.io
|
||||
|
||||
# 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
|
||||
@ podman tag {{image}} {{registry}}/{{image}}
|
||||
@ echo "${{ registry_pass_var }}" | podman login {{registry}} -u {{registry_user}} --password-stdin
|
||||
@ podman push {{registry}}/{{image}}
|
||||
@ podman logout {{registry}}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user