Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract helm-docs generation/testing to Makefile #155

Merged
merged 2 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,7 @@ jobs:
uses: actions/checkout@v2

- name: Run helm-docs and verify docs are up-to-date
run: |
HELM_DOCS_VERSION="0.15.0"
# Avoid polluting repo with helm-docs' README/LICENSE or other files in the release archive
cd /tmp
curl -sL "https://github.com/norwoodj/helm-docs/releases/download/v${HELM_DOCS_VERSION}/helm-docs_${HELM_DOCS_VERSION}_Linux_x86_64.tar.gz" | tar zx
cd -
/tmp/helm-docs
if [[ ! -z "$(git status --porcelain)" ]]; then
echo "Helm docs not up-to-date:"
git status --porcelain
git diff
echo "Run helm-docs, as the CI does above, and commit the updated docs."
exit 1
fi
run: make helm-docs

markdown-link-check:
name: Markdown Links (modified files)
Expand Down
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export DEPLOY_ARGS
GH_URL=https://submariner-io.github.io/submariner-charts/charts
CHARTS_DIR=charts
CHARTS_VERSION=0.7.0
HELM_DOCS_VERSION=0.15.0
REPO_URL=$(shell git config remote.origin.url)

# Process extra flags from the `using=a,b,c` optional flag
Expand All @@ -42,6 +43,20 @@ e2e: E2E_ARGS=cluster1 cluster2
helm dep update $(subst -$(CHARTS_VERSION),,$(basename $(@F)))
helm package --version $(CHARTS_VERSION) $(subst -$(CHARTS_VERSION),,$(basename $(@F)))

helm-docs:
# Avoid polluting repo with helm-docs' README/LICENSE or other files in the release archive
cd /tmp && \
curl -sL https://github.com/norwoodj/helm-docs/releases/download/v$(HELM_DOCS_VERSION)/helm-docs_$(HELM_DOCS_VERSION)_Linux_x86_64.tar.gz | tar zx && \
cd -
/tmp/helm-docs
if [ ! -z $(git status --porcelain) ]; then \
echo "Helm docs not up-to-date:"; \
git status --porcelain; \
git diff; \
echo "Run make helm-docs locally to generate updated docs, commit the updates."; \
exit 1; \
fi

release: submariner-k8s-broker-$(CHARTS_VERSION).tgz submariner-operator-$(CHARTS_VERSION).tgz
git checkout gh-pages
mv *.tgz $(CHARTS_DIR)
Expand All @@ -51,7 +66,7 @@ release: submariner-k8s-broker-$(CHARTS_VERSION).tgz submariner-operator-$(CHART
helm repo index $(CHARTS_DIR) --url $(GH_URL); \
fi

.PHONY: release
.PHONY: release helm-docs

else

Expand Down