TAG=$(git rev-parse --short HEAD)
NAME="docker.dezendorf.net/code-server"
YAML="../../dezendorf/homelab/k3s/codeserver/codeserver.yaml"
docker build --no-cache -t ${NAME}:${TAG} . < Dockerfile
docker push ${NAME}:${TAG}
docker push ${NAME}:latest

echo "Built and pushed:"
echo "  ${NAME}:${TAG}"
echo "  ${NAME}:latest"

sed -i -e "s#$NAME:.*#$NAME:$TAG#g" ${YAML}
git add ${YAML}
git commit -m "releasing $NAME:$TAG"

