X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=meta-starlingx%2Fmeta-stx-virt%2Frecipes-containers%2Fkubernetes%2Ffiles%2Fhelm-upload;fp=meta-starlingx%2Fmeta-stx-virt%2Frecipes-containers%2Fkubernetes%2Ffiles%2Fhelm-upload;h=0000000000000000000000000000000000000000;hb=6fc6934434f70595536a387ece31bc30141cafb5;hp=4dbacc0880f550d1eaa7dd27bf31084e57861953;hpb=eb1e26510491ba49de693ab3b0498edcb06be6c5;p=pti%2Frtp.git diff --git a/meta-starlingx/meta-stx-virt/recipes-containers/kubernetes/files/helm-upload b/meta-starlingx/meta-stx-virt/recipes-containers/kubernetes/files/helm-upload deleted file mode 100644 index 4dbacc0..0000000 --- a/meta-starlingx/meta-stx-virt/recipes-containers/kubernetes/files/helm-upload +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -# -# Copyright (c) 2018 Wind River Systems, Inc. -# -# SPDX-License-Identifier: Apache-2.0 -# - -# This script takes the names of packaged helm charts as arguments. -# It installs them in the on-node helm chart repository and regenerates -# the repository index. - - -# We want to run as the "www" user and scripts can't be setuid. The -# sudoers permissions are set up to allow wrsroot to run this script -# as the "www" user without a password. -if [ $USER != "www" ]; then - exec sudo -u www $0 $@ -fi - - -RETVAL=0 -REINDEX=0 - -REPO_BASE='/www/pages/helm_charts' - -# First argument is always the repo where the charts need to be placed -if [ $# -lt 2 ]; then - echo "Usage: helm-upload .. " - exit 1 -fi - -# Make sure the repo directory exists -REPO_DIR="${REPO_BASE}/$1" -if [ ! -e $REPO_DIR ]; then - echo "$REPO_DIR doesn't exist." - exit 1 -fi - -shift 1 - -for FILE in "$@"; do - if [ -r $FILE ]; then - # QUESTION: should we disallow overwriting an existing file? - # The versions are embedded in the filename, so it shouldn't - # cause problems. - cp $FILE $REPO_DIR - if [ $? -ne 0 ]; then - echo Problem adding $FILE to helm chart registry. - RETVAL=1 - else - REINDEX=1 - fi - else - echo Cannot read file ${FILE}. - RETVAL=1 - fi -done - - -# Now re-index the helm repository if we successfully copied in -# any new charts. -if [ $REINDEX -eq 1 ]; then - /usr/sbin/helm repo index $REPO_DIR -fi - -exit $RETVAL