add podman push
This commit is contained in:
parent
1f4945fa4b
commit
9bad824eaf
1 changed files with 17 additions and 0 deletions
17
podman_push.sh
Normal file
17
podman_push.sh
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
repo="$(basename "$(pwd)")"
|
||||
tag="${1}"
|
||||
if [ -z "${tag}" ]; then
|
||||
git_reference=$(grep '^ref: ' .git/HEAD | awk 'BEGIN {FS="/"} {print($NF)}')
|
||||
if [ "${git_reference}" == 'master' ] || [ "${git_reference}" == 'main' ] || [ -z "${git_reference}" ]; then
|
||||
echo "Change to a different git reference not 'master/main', since it will be used as tag for the container. Or pass a tag name as only parameter."
|
||||
exit 1
|
||||
fi
|
||||
tag="${git_reference}"
|
||||
fi
|
||||
echo "Building '${repo}:${tag}'..."
|
||||
podman build --tag "${repo}:${tag}" .
|
||||
echo "Tagging it to 'repos.susurrando.com/adelgado/${repo}:${tag}'..."
|
||||
podman tag "${repo}:${tag}" "repos.susurrando.com/adelgado/${repo}:${tag}"
|
||||
echo "Pushing it to 'repos.susurrando.com/adelgado/${repo}:${tag}'..."
|
||||
podman push "repos.susurrando.com/adelgado/${repo}:${tag}"
|
Loading…
Reference in a new issue