Jeremy Phelps | 3cffa43 | 2018-08-15 16:26:12 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -e -o pipefail |
Sylvain Desbureaux | f5eb026 | 2021-06-21 08:12:34 +0200 | [diff] [blame] | 4 | echo "*** starting releace process for $BUILD_TYPE" |
Jeremy Phelps | 3cffa43 | 2018-08-15 16:26:12 -0500 | [diff] [blame] | 5 | cd kubernetes/dist/packages/ || exit |
| 6 | helm_charts=() |
| 7 | while IFS= read -a line; do |
| 8 | helm_charts+=( "$line" ) |
| 9 | done < <( ls ) |
| 10 | |
| 11 | for chart in "${helm_charts[@]}"; do |
| 12 | chart=$(echo "$chart" | xargs) |
Sylvain Desbureaux | f5eb026 | 2021-06-21 08:12:34 +0200 | [diff] [blame] | 13 | echo " ** processing chart $chart" |
Jeremy Phelps | 3cffa43 | 2018-08-15 16:26:12 -0500 | [diff] [blame] | 14 | case "$BUILD_TYPE" in |
| 15 | 'snapshot') |
Sylvain Desbureaux | f5eb026 | 2021-06-21 08:12:34 +0200 | [diff] [blame] | 16 | echo " * snapshot build, pushing to https://nexus3.onap.org/repository/onap-helm-testing/" |
| 17 | curl -vn --upload-file "$chart" "https://nexus3.onap.org/repository/onap-helm-testing/" |
Jeremy Phelps | 3cffa43 | 2018-08-15 16:26:12 -0500 | [diff] [blame] | 18 | ;; |
| 19 | 'staging') |
Sylvain Desbureaux | f5eb026 | 2021-06-21 08:12:34 +0200 | [diff] [blame] | 20 | echo " * staging build, pushing to https://nexus3.onap.org/repository/onap-helm-testing/" |
| 21 | curl -vn --upload-file "$chart" "https://nexus3.onap.org/repository/onap-helm-testing/" |
Jeremy Phelps | 3cffa43 | 2018-08-15 16:26:12 -0500 | [diff] [blame] | 22 | ;; |
| 23 | 'release') |
Sylvain Desbureaux | f5eb026 | 2021-06-21 08:12:34 +0200 | [diff] [blame] | 24 | echo " * release build, pushing to https://nexus3.onap.org/repository/onap-helm-release/" |
Sylvain Desbureaux | 2915ed8 | 2021-05-28 16:08:58 +0200 | [diff] [blame] | 25 | curl -n --upload-file "$chart" "https://nexus3.onap.org/repository/onap-helm-release/" |
Jeremy Phelps | 3cffa43 | 2018-08-15 16:26:12 -0500 | [diff] [blame] | 26 | ;; |
| 27 | *) |
| 28 | echo "You must set BUILD_TYPE to one of (snapshot, staging, release)." |
| 29 | exit 1 |
| 30 | ;; |
| 31 | esac |
| 32 | done |
Sylvain Desbureaux | f5eb026 | 2021-06-21 08:12:34 +0200 | [diff] [blame] | 33 | echo "*** release process finished" |
Jeremy Phelps | 3cffa43 | 2018-08-15 16:26:12 -0500 | [diff] [blame] | 34 | cd ../../../ |