summaryrefslogtreecommitdiffstats
path: root/shell/helm/publish_helm_charts.sh
blob: 46017432874cf8c0c16f76412176b2f573266c6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash

set -e -o pipefail
echo "*** starting chart publish process for $BUILD_TYPE"
cd kubernetes/dist/packages/ || exit
helm_charts=()
while IFS= read -a line; do
    helm_charts+=( "$line" )
done < <( ls )

for chart in "${helm_charts[@]}"; do
  chart=$(echo "$chart" | xargs)
  echo " ** processing chart $chart"
  case "$BUILD_TYPE" in
    'snapshot')
      echo "  * snapshot build, pushing to https://nexus3.onap.org/repository/onap-helm-testing/"
      curl -vn --upload-file "$chart" "https://nexus3.onap.org/repository/onap-helm-testing/"
      ;;
    'release')
      echo "  * release build, pushing to https://nexus3.onap.org/repository/onap-helm-release/"
      curl -vn --upload-file "$chart" "https://nexus3.onap.org/repository/onap-helm-release/"
        ;;
    *)
      echo "You must set BUILD_TYPE to one of (snapshot, release)."
      exit 1
      ;;
  esac
done
echo "*** chart publish process finished"
cd ../../../