jenkins-pipelines/scripts/archive-helm-charts.sh
Davlet Panech be58140638 Add license and copyright
Story: 2010226
Task: 46011

Change-Id: I721f1509637b910c05e4151eeb7ad7e1cb8db119
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2022-08-15 14:16:07 -04:00

36 lines
856 B
Bash
Executable File

#!/bin/bash
#
# Copyright (c) 2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
source $(dirname "$0")/lib/job_utils.sh
load_build_env
#VERBOSE_ARG="--verbose"
dir_is_empty() {
if [[ -d "$1" ]] ; then
[[ $(find "$1" -mindepth 1 -maxdepth 1 -print -quit | wc -l) -le 0 ]]
else
return 0
fi
}
if ! dir_is_empty "$BUILD_HOME/workspace/helm-charts" ; then
my_user="$(id -u)"
my_group="$(id -g)"
if [[ ! -d "$BUILD_OUTPUT_HOME/workspace/helm-charts" ]] ; then
mkdir "$BUILD_OUTPUT_HOME/workspace/helm-charts"
fi
safe_copy_dir $DRY_RUN_ARG $VERBOSE_ARG --delete --chown $my_user:$my_group \
"$BUILD_HOME/workspace/helm-charts/" \
"$BUILD_OUTPUT_HOME/workspace/helm-charts/"
notice "Helm charts archived in $BUILD_OUTPUT_HOME/workspace/helm-charts"
fi