Skip to content

Commit

Permalink
speedup for 'make upload-charts' by inlining loop
Browse files Browse the repository at this point in the history
inlining the loop. Whoohoo. Still slow :/
  • Loading branch information
jschaul committed Dec 29, 2020
1 parent b5d1d91 commit b966d27
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -313,4 +313,9 @@ upload-chart-%: release-chart-%
# To uplaod all helm charts in the CHARTS_RELEASE list (see top of the time)
# (assummption: CI sets DOCKER_TAG and HELM_SEMVER)
.PHONY: upload-charts
upload-charts: $(foreach chartName,$(CHARTS_RELEASE),upload-chart-$(chartName))
upload-charts: charts-release
./hack/bin/upload-helm-charts-s3.sh

.PHONY: echo-release-charts
echo-release-charts:
@echo ${CHARTS_RELEASE}
7 changes: 4 additions & 3 deletions hack/bin/upload-helm-charts-s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# for more info see https://github.com/hypnoglow/helm-s3

set -eo pipefail
set -x

USAGE="Upload helm charts to S3. Usage: $0 to upload all charts or $0 <chart-directory> to sync only a single one. --force-push can be used to override S3 artifacts. --reindex can be used to force a complete reindexing in case the index is malformed."

Expand Down Expand Up @@ -48,7 +47,9 @@ if [ -n "$chart_dir" ] && [ -d "$chart_dir" ]; then
echo "only syncing $chart_name"
charts=( "$chart_name" )
else
charts=( $(find $CHART_DIR/ -maxdepth 1 -type d | sed -n "s=$CHART_DIR/\(.\+\)=\1 =p") )
charts=$(make -s -C "$TOP_LEVEL_DIR" echo-release-charts)
# See Makefile/ CHARTS_RELEASE FUTUREWORK
#charts=( $(find $CHART_DIR/ -maxdepth 1 -type d | sed -n "s=$CHART_DIR/\(.\+\)=\1 =p") )
fi

# install s3 plugin if not present
Expand Down Expand Up @@ -108,7 +109,7 @@ if [[ $1 == *--reindex* || $2 == *--reindex* || $3 == *--reindex* ]]; then
else
# update local cache with newly pushed charts
helm repo update
printf "\n--> Not reindexing by default. Pass the --reindex flag in case the index.yaml is incomplete. See all wire charts using \n helm search $REPO_NAME/ -l\n\n"
printf "\n--> Not reindexing by default. Pass the --reindex flag in case the index.yaml is incomplete. See all wire charts using \n helm search repo $REPO_NAME/ -l\n\n"
fi


Expand Down

0 comments on commit b966d27

Please sign in to comment.