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

Makefile: set the url of chart repository #6

Closed
wants to merge 1 commit into from
Closed
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
23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ STABLE_TARGETS = $(shell hack/chart_destination.sh $(STABLE_CHARTS))
STAGING_CHARTS = $(wildcard staging/*/Chart.yaml)
STAGING_TARGETS = $(shell hack/chart_destination.sh $(STAGING_CHARTS))

PULL_REQUEST_ID := pullrequest_publish_$(shell /bin/bash -c "echo $$RANDOM")

TMPDIR := $(shell mktemp -d)
HELM := $(shell bash -c "command -v helm")
ifeq ($(HELM),)
Expand All @@ -21,10 +23,22 @@ clean:
@rm -rf docs/staging docs/stable

.PHONY: stagingrepo
stagingrepo: docs/staging/index.yaml $(STAGING_TARGETS)
stagingrepo: $(STAGING_TARGETS) | docs/staging/index.yaml

.PHONY: stablerepo
stablerepo: docs/stable/index.yaml $(STABLE_TARGETS)
stablerepo: $(STABLE_TARGETS) | docs/stable/index.yaml

.PHONY: publish-ci
publish-ci:
@git remote add publish git@github.com:mesosphere/charts >/dev/null 2>&1 || true
@git branch -d master >/dev/null 2>&1 || true
@git checkout -B master
@make all
@git add .
@git commit -m 'docs: publish repo updates'
@git push -f publish $(PULL_REQUEST_ID)
@git request-pull master ./
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the final intention would be to open a PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want a PR, I want a push. The review was already done for the dev branch. I would call master anything else but github pages will only publish from a branch named "master".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why all PR's are supposed to be against dev.

@git checkout -

.PHONY: publish
publish:
Expand All @@ -33,7 +47,7 @@ publish:
@git checkout -B master
@make all
@git add .
@git commit -m 'publish repo'
@git commit -m 'docs: publish repo updates'
@echo git push -f publish master
@git checkout -

Expand All @@ -50,8 +64,7 @@ $(STABLE_TARGETS) $(STAGING_TARGETS): $(TMPDIR)/.helm/repository/local/index.yam
%/index.yaml: $(STABLE_TARGETS) $(STAGING_TARGETS)
%/index.yaml: $(TMPDIR)/.helm/repository/local/index.yaml
@mkdir -p $(patsubst %/index.yaml,%,$@)
$(HELM) --home $(TMPDIR)/.helm repo index $(patsubst %/index.yaml,%,$@)
$(HELM) --home $(TMPDIR)/.helm repo index $(patsubst %/index.yaml,%,$@) --url=https://mesosphere.github.io/charts/$(patsubst docs/%index.yaml,%,$@)

$(TMPDIR)/.helm/repository/local/index.yaml: $(HELM)
$(HELM) --home $(TMPDIR)/.helm init --client-only