Skip to content

Commit

Permalink
Add workaround to populate index.yaml
Browse files Browse the repository at this point in the history
This will download all releases before cr index is being run.
fixes ansible#1053
  • Loading branch information
janorn authored Sep 28, 2022
1 parent 1892b8f commit 4c5c43b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ helm-package: cr helm-chart
@echo "== CHART RELEASER (package) =="
$(CR) package ./charts/awx-operator

# List all tags oldest to newest.
TAGS := $(shell git tag -l --sort=creatordate)

# The actual release happens in ansible/helm-release.yml
# until https://github.com/helm/chart-releaser/issues/122 happens
.PHONY: helm-index
Expand All @@ -362,6 +365,20 @@ helm-index: cr helm-chart
git remote add httpsorigin "https://github.com/$(CHART_OWNER)/$(CHART_REPO).git"
git fetch httpsorigin

# This step to workaround issues with old releases being dropped.
# Until https://github.com/helm/chart-releaser/issues/133 happens
@echo "== CHART FETCH previous releases =="
# Download all old releases
cd .cr-release-packages;\
for tag in $(TAGS); do\
dl_url="https://github.com/$${CHART_OWNER}/$${CHART_REPO}/releases/download/$${tag}/$${CHART_REPO}-$${tag}.tgz";\
curl -RLOs -z "$${CHART_REPO}-$${tag}.tgz" --fail $${dl_url};\
result=$$?;\
if [ $${result} -eq 0 ]; then\
echo "Downloaded $$dl_url";\
fi;\
done

@echo "== CHART RELEASER (index) =="
$(CR) index \
--owner "$(CHART_OWNER)" \
Expand Down

0 comments on commit 4c5c43b

Please sign in to comment.