#!/bin/sh

chartname=$(basename $(cd $(dirname $0) && pwd))
. $(dirname "$0")/../../utils/sync-init.sh

branch=master
version=$(curl https://gitlab.triumf.ca/k8s/helm/charts/phpipam/-/raw/master/Chart.yaml 2>/dev/null| yq e '.version' - )
base_repo=https://gitlab.triumf.ca/k8s/helm/
sub_dir=charts/phpipam


test -d $(dirname $0)/$version && die "$chartname: version $version exist.."
echo "Found new version $chartname: $version"
test ! -d $(dirname $0)/$version && is_dry && sync_repo "$branch" "$base_repo" "$sub_dir" "$version" "$chartname"
