ungleich-containers/build.sh

22 lines
315 B
Bash
Raw Normal View History

2024-02-20 12:52:25 +00:00
#!/bin/sh
set -exu
2024-02-20 13:15:55 +00:00
if [ $# -lt 2 ]; then
echo "$0 <container> <version> [push]" >&2
2024-02-20 12:52:25 +00:00
exit 1
fi
container=$1; shift
version=$1; shift
2024-02-20 13:15:55 +00:00
name=harbor.k8s.ungleich.ch/ungleich-public/${container}
2024-02-20 12:52:25 +00:00
tag=${name}:${version}
2024-02-20 13:15:55 +00:00
cd $container
2024-02-20 12:52:25 +00:00
docker build -t ${tag} .
2024-02-20 13:15:55 +00:00
if [ "$#" -ge 1 ]; then
docker push ${tag}
fi