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

Migrate dev-env from scripts to Makefile #212

Open
nabokihms opened this issue May 20, 2022 · 2 comments
Open

Migrate dev-env from scripts to Makefile #212

nabokihms opened this issue May 20, 2022 · 2 comments
Labels
good first issue Good for newcomers

Comments

@nabokihms
Copy link
Contributor

I will describe the idea using the helm-docs.sh script, but it is also applicable to others.

The following tries to download helm-docs binary every time and puts the binary into the script execution folder.

# install helm-docs
curl --silent --show-error --fail --location --output /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_${OS}_x86_64.tar.gz
tar -xf /tmp/helm-docs.tar.gz helm-docs

Makefile could be an entrypoint for these interactions. We could download the binary once and then use it from the predefined directory.

bin/helm-docs: bin/helm-docs-${HELM_DOCS_VERSION}
	@ln -sf helm-docs-${HELM_DOCS_VERSION} bin/helm-docs

bin/helm-docs-${HELM_DOCS_VERSION}:
	@mkdir -p bin
	curl -L https://github.com/norwoodj/helm-docs/releases/download/v${HELM_DOCS_VERSION}/helm-docs_${HELM_DOCS_VERSION}_$(shell uname)_x86_64.tar.gz | tar -zOxf - helm-docs > ./bin/helm-docs-${HELM_DOCS_VERSION} && chmod +x ./bin/helm-docs-${HELM_DOCS_VERSION}

And they use it like this

.PHONY: docs
docs: bin/helm-docs
	bin/helm-docs

It would be possible to download yq the same way.

Just an idea.

@spencergilbert
Copy link
Contributor

Strong agree! That script is/was definitely meant to be used in CI rather than users but that's not obvious either, and we can improve this in a few ways - mostly haven't done it because it's mostly just me doing commits 😄

@spencergilbert spencergilbert added the good first issue Good for newcomers label May 20, 2022
@spencergilbert
Copy link
Contributor

Noting for the specific example of for helm-docs I moved the installation and check commands out of the script and directly into the gh action config here: #263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants