Jeremy Phelps | 3cffa43 | 2018-08-15 16:26:12 -0500 | [diff] [blame] | 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') |
Jeremy Phelps | 954af3c | 2018-11-28 16:13:25 -0600 | [diff] [blame] | 14 | echo "-n --upload-file $chart https://nexus.onap.org/content/sites/oom-helm-$BUILD_TYPE/$GERRIT_BRANCH/$chart" |
| 15 | curl -n --upload-file "$chart" "https://nexus.onap.org/content/sites/oom-helm-$BUILD_TYPE/$GERRIT_BRANCH/$chart" |
| 16 | curl -n --upload-file "$chart" "https://nexus.onap.org/content/sites/oom-helm-$BUILD_TYPE//$GERRIT_BRANCH/$GIT_COMMIT/$chart" |
Jeremy Phelps | 3cffa43 | 2018-08-15 16:26:12 -0500 | [diff] [blame] | 17 | ;; |
| 18 | 'staging') |
Jeremy Phelps | 954af3c | 2018-11-28 16:13:25 -0600 | [diff] [blame] | 19 | curl -n --upload-file "$chart" "https://nexus.onap.org/content/sites/oom-helm-$BUILD_TYPE/$GERRIT_BRANCH/$chart" |
| 20 | curl -n --upload-file "$chart" "https://nexus.onap.org/content/sites/oom-helm-$BUILD_TYPE/$GERRIT_BRANCH/$GIT_COMMIT/$chart" |
Jeremy Phelps | 3cffa43 | 2018-08-15 16:26:12 -0500 | [diff] [blame] | 21 | ;; |
| 22 | 'release') |
| 23 | echo "Release automation not implemented yet." |
| 24 | exit 1 |
| 25 | ;; |
| 26 | *) |
| 27 | echo "You must set BUILD_TYPE to one of (snapshot, staging, release)." |
| 28 | exit 1 |
| 29 | ;; |
| 30 | esac |
| 31 | done |
| 32 | cd ../../../ |