-
Notifications
You must be signed in to change notification settings - Fork 16
Simplify repo base generation #331
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,27 +61,24 @@ generate-go-mod-tidy: | $(NEEDS_GO) | |
|
|
||
| shared_generate_targets += generate-go-mod-tidy | ||
|
|
||
| ifndef govulncheck_skip | ||
| base_dir := $(dir $(lastword $(MAKEFILE_LIST)))/base/ | ||
|
|
||
| default_govulncheck_generate_base_dir := $(dir $(lastword $(MAKEFILE_LIST)))/base/ | ||
| # The base directory used to copy the govulncheck GH action from. This can be | ||
| # overwritten with an action with extra authentication or with a totally different | ||
| # pipeline (eg. a GitLab pipeline). | ||
| govulncheck_generate_base_dir ?= $(default_govulncheck_generate_base_dir) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was not used, use |
||
|
|
||
| # The org name used in the govulncheck GH action. This is used to prevent the govulncheck job | ||
| # being run on every fork of the repo. | ||
| govulncheck_generate_org ?= cert-manager | ||
| ifndef dont_generate_govulncheck | ||
|
|
||
| .PHONY: generate-govulncheck | ||
| ## Generate base files in the repository | ||
| ## @category [shared] Generate/ Verify | ||
| generate-govulncheck: | ||
| @mkdir -p ./.github/workflows | ||
| sed 's/ORGNAMEHERE/$(govulncheck_generate_org)/g' $(govulncheck_generate_base_dir)/.github/workflows/govulncheck.yaml > .github/workflows/govulncheck.yaml | ||
| cp -r $(base_dir)/. ./ | ||
| cd $(base_dir) && \ | ||
| find . -type f | while read file; do \ | ||
| sed "s|{{REPLACE:GH-REPOSITORY}}|$(repo_name:github.com/%=%)|g" "$$file" > "$(CURDIR)/$$file"; \ | ||
| done | ||
|
|
||
| shared_generate_targets += generate-govulncheck | ||
|
|
||
| endif # dont_generate_govulncheck | ||
|
|
||
| .PHONY: verify-govulncheck | ||
| ## Verify all Go modules for vulnerabilities using govulncheck | ||
| ## @category [shared] Generate/ Verify | ||
|
|
@@ -107,9 +104,6 @@ verify-govulncheck: | $(NEEDS_GOVULNCHECK) | |
| echo ""; \ | ||
| done | ||
|
|
||
| endif # govulncheck_skip | ||
|
|
||
|
|
||
| .PHONY: generate-golangci-lint-config | ||
| ## Generate a golangci-lint configuration file | ||
| ## @category [shared] Generate/ Verify | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,10 +16,6 @@ ifndef bin_dir | |
| $(error bin_dir is not set) | ||
| endif | ||
|
|
||
| ifndef repo_name | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was unused here.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I see. That variable is used elsewhere in other modules, just not in helm module so no need to error here if the variable is unset. |
||
| $(error repo_name is not set) | ||
| endif | ||
|
|
||
| ifndef helm_chart_source_dir | ||
| $(error helm_chart_source_dir is not set) | ||
| endif | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.