Merge "Updating ncmp-dmi-plugin jjb project name"
[ci-management.git] / shell / publish_helm_charts.sh
1 #!/bin/bash
2
3 set -e -o pipefail
4 cd kubernetes/dist/packages/ || exit
5 helm_charts=()
6 while IFS= read -a line; do
7     helm_charts+=( "$line" )
8 done < <( ls )
9
10 for chart in "${helm_charts[@]}"; do
11   chart=$(echo "$chart" | xargs)
12   case "$BUILD_TYPE" in
13     'snapshot')
14       curl -n --upload-file "$chart" "https://nexus3.onap.org/repository/onap-helm-testing/"
15       ;;
16     'staging')
17       curl -n --upload-file "$chart" "https://nexus3.onap.org/repository/onap-helm-testing/"
18       ;;
19     'release')
20       curl -n --upload-file "$chart" "https://nexus3.onap.org/repository/onap-helm-release/"
21         ;;
22     *)
23       echo "You must set BUILD_TYPE to one of (snapshot, staging, release)."
24       exit 1
25       ;;
26   esac
27 done
28 cd ../../../