2022-03-05 09:26:09 +00:00
#!/usr/bin/env bash
ABSDIR = " $( dirname " $( readlink -f -- " $0 " ) " ) "
2023-07-29 07:14:59 +00:00
source " ${ ABSDIR } " /../functions.sh
source " ${ ABSDIR } " /vars.sh
2022-03-05 09:26:09 +00:00
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 " | \t ar xz --strip-components 1 -C ${ buildfolder } / &&
2023-10-22 06:20:47 +00:00
TMPDIR = ${ HOME } podman image build \
2022-12-13 21:40:46 +00:00
--label org.opencontainers.image.description= 'PeerServer helps establishing connections between PeerJS clients. Data is not proxied through the server.' \
--label org.opencontainers.image.source= 'https://github.com/peers/peerjs-server' \
--label org.opencontainers.image.title= 'PeerServer' \
--label org.opencontainers.image.url= 'https://peerjs.com' \
2023-07-28 21:08:44 +00:00
-t ${ upstream_images } :${ version } ${ buildfolder } / || retval = false
2023-10-28 15:41:15 +00:00
podman image prune -a -f --filter dangling = true
podman image prune -a -f --filter intermediate = true
2023-10-28 15:16:30 +00:00
podman image rm -f $( podman image list -a -q -- docker.io/library/node)
2022-08-12 17:50:11 +00:00
rm -rf ${ buildfolder }
2023-07-29 07:14:59 +00:00
eval " $retval "
2022-08-12 18:09:34 +00:00
else
echo " Image ${ upstream_images } : ${ version } already built "
2022-08-12 17:49:06 +00:00
fi &&
2022-08-12 17:42:46 +00:00
2022-08-12 18:24:33 +00:00
oci_push_to_registry ${ upstream_images } :${ version }