Chore: Remove stable/argon jobs
[releng/builder.git] / jjb / packaging / publish-helm-charts.sh
1 #!/bin/bash -l
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2021 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> publish-help-charts.sh"
12
13 set -e -o pipefail
14 echo "*** starting releace process for $BUILD_TYPE"
15 ls -l
16 pwd
17 cd "$WORKSPACE/helm/opendaylight" || exit
18 helm_charts=()
19 while IFS= read -rd $'\n'; do
20     helm_charts+=("$line")
21 done < <(find "$WORKSPACE/helm/opendaylight")
22
23 for chart in "${helm_charts[@]}"; do
24   chart=$(echo "$chart" | xargs)
25   echo " ** processing chart $chart"
26   case "$BUILD_TYPE" in
27     'snapshot')
28       echo "  * snapshot build, pushing to https://nexus3.opendaylight.org/repository/packaging-helm-testing/"
29       curl -vn --upload-file "$chart" "https://nexus3.opendaylight.org/repository/packaging-helm-testing/"
30       ;;
31     'staging')
32       echo "  * staging build, pushing to https://nexus3.opendaylight.org/repository/packaging-helm-testing/"
33       curl -vn --upload-file "$chart" "https://nexus3.opendaylight.org/repository/packaging-helm-testing/"
34       ;;
35     'release')
36       echo "  * release build, pushing to https://nexus3.opendaylight.org/repository/packaging-helm-release/"
37       curl -n --upload-file "$chart" "https://nexus3.opendaylight.org/repository/packaging-helm-release/"
38         ;;
39     *)
40       echo "You must set BUILD_TYPE to one of (snapshot, staging, release)."
41       exit 1
42       ;;
43   esac
44 done
45 echo "*** release process finished"
46 cd ../../../