Skip to content

Instantly share code, notes, and snippets.

@JPWKU
Created November 5, 2018 20:54
Show Gist options
  • Save JPWKU/61adb59eee57390dccc37b9ada0668c2 to your computer and use it in GitHub Desktop.
Save JPWKU/61adb59eee57390dccc37b9ada0668c2 to your computer and use it in GitHub Desktop.
OOM_GIT_SHA=$1
NEXUS_HELM_STAGING_PATH="https://nexus.onap.org/content/sites/oom-helm-staging/$OOM_GIT_SHA"
NEXUS_HELM_RELEASE_PATH="https://nexus.onap.org/content/sites/oom-helm-release/3.0.0"
echo $OOM_GIT_SHA
echo $NEXUS_HELM_STAGING_PATH
echo $NEXUS_HELM_RELEASE_PATH
# fetch index.yaml
curl -o index.yaml "$NEXUS_HELM_STAGING_PATH/index.yaml"
# parse available charts from index.yaml
helm_charts=()
while IFS= read -a line; do
helm_charts+=( "$line" )
done < <( cat index.yaml | grep -w tgz | awk -F ' ' '{print $2}' )
# download available charts
for chart in "${helm_charts[@]}"; do
chart=$(echo "$chart" | xargs)
curl -o $chart "$NEXUS_HELM_STAGING_PATH/$chart"
done
# gpg sign index.yaml and all charts.
helm_charts+=( "index.yaml" )
lftools sign dir .
# push all charts, index.yaml, and associated asc files to release repo.
for chart in "${helm_charts[@]}"; do
chart=$(echo "$chart" | xargs)
curl -n --upload-file $chart $NEXUS_HELM_RELEASE_PATH/$chart
curl -n --upload-file "$chart.asc" "$NEXUS_HELM_RELEASE_PATH/$chart.asc"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment