mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-23 07:17:02 +00:00
Merge pull request #5303 from antoooks/refactor/ci-tasks-improvement-new
refactor/ci tasks improvement new
This commit is contained in:
10
Makefile
10
Makefile
@@ -108,6 +108,9 @@ verify-kustomize-repo: \
|
||||
.PHONY: prow-presubmit-check
|
||||
prow-presubmit-check: \
|
||||
install-tools \
|
||||
workspace-sync \
|
||||
generate-kustomize-builtin-plugins \
|
||||
builtin-plugins-diff \
|
||||
test-unit-kustomize-plugins \
|
||||
test-go-mod \
|
||||
build-non-plugin-all \
|
||||
@@ -181,7 +184,12 @@ test-examples-kustomize-against-HEAD: $(MYGOBIN)/kustomize $(MYGOBIN)/mdrip
|
||||
test-examples-kustomize-against-latest-release: $(MYGOBIN)/mdrip
|
||||
./hack/testExamplesAgainstKustomize.sh v5@$(LATEST_RELEASE)
|
||||
|
||||
|
||||
# Pushes dependencies in the go.work file back to go.mod files of each workspace module.
|
||||
.PHONY: workspace-sync
|
||||
workspace-sync:
|
||||
go work sync
|
||||
./hack/doGoMod.sh tidy
|
||||
|
||||
# --- Cleanup targets ---
|
||||
.PHONY: clean
|
||||
clean: clean-kustomize-external-go-plugin uninstall-tools
|
||||
|
||||
@@ -89,9 +89,27 @@ $(pGen)/%.go: $(MYGOBIN)/pluginator $(MYGOBIN)/goimports
|
||||
$(MYGOBIN)/goimports -w $*.go \
|
||||
)
|
||||
|
||||
# Target is for debugging.
|
||||
# Generate builtin plugins
|
||||
.PHONY: generate-kustomize-builtin-plugins
|
||||
generate-kustomize-builtin-plugins: $(builtinplugins)
|
||||
generate-kustomize-builtin-plugins: $(builtplugins)
|
||||
for plugin in $(abspath $(wildcard $(pSrc)/*)); do \
|
||||
echo "generating $${plugin} ..."; \
|
||||
set -e; \
|
||||
cd $${plugin}; \
|
||||
go generate pluginator .; \
|
||||
done
|
||||
|
||||
# Check for diff by comparing current revision of generated plugins on HEAD and newly generated plugins on local branch,
|
||||
# If diff is found, throw error code 1
|
||||
.PHONY: builtin-plugins-diff
|
||||
builtin-plugins-diff: $(builtplugins)
|
||||
for file in $(abspath $(builtinplugins)); do \
|
||||
echo "Checking for diff... $${file}" ; \
|
||||
set -e ; \
|
||||
if [ "`git diff $${file} | wc -c`" -gt 0 ]; then\
|
||||
echo "Error(1): diff found on $${file}"; exit 1; \
|
||||
fi \
|
||||
done
|
||||
|
||||
.PHONY: build-kustomize-external-go-plugin
|
||||
build-kustomize-external-go-plugin:
|
||||
|
||||
@@ -62,7 +62,6 @@ func ConvertToBuiltInPlugin() (retErr error) {
|
||||
w.write(
|
||||
fmt.Sprintf(
|
||||
"// pluginator %s\n", provenance.GetProvenance().Short()))
|
||||
w.write("\n")
|
||||
w.write("package " + packageForGeneratedCode)
|
||||
|
||||
pType := unknown
|
||||
@@ -73,6 +72,8 @@ func ConvertToBuiltInPlugin() (retErr error) {
|
||||
continue
|
||||
}
|
||||
if strings.HasPrefix(l, "var "+konfig.PluginSymbol+" plugin") {
|
||||
// Hack to skip leading new line
|
||||
scanner.Scan()
|
||||
continue
|
||||
}
|
||||
if strings.Contains(l, " Transform(") {
|
||||
@@ -93,7 +94,7 @@ func ConvertToBuiltInPlugin() (retErr error) {
|
||||
}
|
||||
w.write("")
|
||||
w.write("func New" + root + "Plugin() resmap." + pType.String() + "Plugin {")
|
||||
w.write(" return &" + root + "Plugin{}")
|
||||
w.write(" return &" + root + "Plugin{}")
|
||||
w.write("}")
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user