Skip to content

Commit

Permalink
Add workflow to sync cni-metrics-helper helm chart to eks-charts
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviassss committed Dec 20, 2021
1 parent 2af69b2 commit ddc204f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scripts/sync-to-eks-charts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
BUILD_DIR="${SCRIPTPATH}/../build"

REPO="aws/amazon-vpc-cni-k8s"
HELM_CHART_NAME="aws-vpc-cni"
HELM_CHART_NAME=${HELM_CHART_NAME:-'aws-vpc-cni'}
HELM_CHART_BASE_BIR="${SCRIPTPATH}/../charts"

CHARTS_REPO="aws/eks-charts"
CHARTS_REPO_NAME=$(echo ${CHARTS_REPO} | cut -d'/' -f2)

HELM_CHART_DIR="${HELM_CHART_BASE_BIR}/${HELM_CHART_NAME}"
PR_ID=$(uuidgen | cut -d '-' -f1)

SYNC_DIR="${BUILD_DIR}/eks-charts-sync"
Expand All @@ -29,7 +28,7 @@ if [[ "${KERNEL}" == "darwin" ]]; then
OS="macOS"
fi

VERSION=$(make -s -f "${SCRIPTPATH}/../Makefile" version)
VERSION=$(echo $(make -s -f "${SCRIPTPATH}/../Makefile" version) | cut -d'-' -f1)

USAGE=$(cat << EOM
Usage: sync-to-eks-charts -r <repo>
Expand All @@ -52,6 +51,7 @@ while getopts "b:r:n" opt; do
REPO="$OPTARG"
;;
b ) # binary basename
HELM_CHART_NAME="$OPTARG"
BINARY_BASE="$OPTARG"
;;
n ) # Include release notes
Expand All @@ -64,6 +64,14 @@ while getopts "b:r:n" opt; do
esac
done

if [[ "$HELM_CHART_NAME" =~ ^(aws-vpc-cni|cni-metrics-helper)$ ]]; then
echo "chose to sync chart $HELM_CHART_NAME"
else
echo "invalid chart name, quit the script"
exit 0
fi

HELM_CHART_DIR="${HELM_CHART_BASE_BIR}/${HELM_CHART_NAME}"

if [[ -z "${REPO}" ]]; then
echo "Repo (-r) must be specified if no \"make repo-full-name\" target exists"
Expand Down

0 comments on commit ddc204f

Please sign in to comment.