#!/usr/bin/env bash

service_name="$1"

helm_chart_version=$($SCRIPT_DIR/get_tag_version.sh)
./run_helm_test.sh
cd src/main/helm
helm package --version=$helm_chart_version .

if [[ "$CI_COMMIT_REF_NAME" == "release" ]]; then
  repository=ozg-base-apps
else
  repository=ozg-base-apps-snapshot
fi
curl -u $NEXUS_USER:$NEXUS_PASSWORD -F file=@$service_name-$helm_chart_version.tgz https://nexus.ozg-sh.de/service/rest/v1/components?repository=$repository
