#!/bin/bash
set -e

ERCC_TAG="$(git describe --tags --abbrev=0 $(git rev-list --tags --max-count=1))"
VERSION=${ERCC_TAG:-latest}

earthly --push +docker
echo sed ../kubernetes/*-deployment.yaml -e \"'s#\(.*image: gitlab.inf.unibz.it:4567/.*:\).*#\1'"${VERSION}#"\"