2022-03-05 09:26:09 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
|
|
|
|
source ${ABSDIR}/../functions.sh
|
|
|
|
source ${ABSDIR}/vars.sh
|
|
|
|
|
|
|
|
ensure_pwd_is_scriptdir
|
|
|
|
ensure_not_root
|
|
|
|
|
|
|
|
buildfolder=/tmp/peerjs-server-$$
|
|
|
|
|
|
|
|
if ! podman image exists ${upstream_images}:${version}; then
|
2022-03-05 09:30:15 +00:00
|
|
|
mkdir ${buildfolder} &&
|
2022-03-05 09:26:09 +00:00
|
|
|
curl -sSfL -- "https://github.com/peers/peerjs-server/archive/refs/tags/v${version}.tar.gz" | \tar xz --strip-components 1 -C ${buildfolder}/ &&
|
|
|
|
sed_in_place "^FROM node:alpine" "FROM docker.io/library/node:alpine" ${buildfolder}/Dockerfile
|
|
|
|
podman build -t ${upstream_images}:${version} ${buildfolder}/
|
|
|
|
podman rmi docker.io/library/node:alpine
|
|
|
|
rm -rf ${buildfolder}
|
|
|
|
fi
|
2022-08-12 17:42:46 +00:00
|
|
|
|
2022-08-12 17:46:27 +00:00
|
|
|
if ! skopeo inspect --format "ok" docker://${upstream_images}:${version}; then
|
2022-08-12 17:42:46 +00:00
|
|
|
podman login --username ${CONTAINER_REPO_USER} --password ${CONTAINER_REPO_PASSWORD} ${upstream_images%%/*}
|
|
|
|
for i in $(seq 1 3); do podman push ${upstream_images}:${version} && s=0 && break || s=$? && sleep 1; done; (exit $s)
|
|
|
|
fi
|