Skip to content
Merged
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
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

ifdef ACCTEST_PACKAGES
# remove newlines and blanks coming from GH Actions
ACCTEST_PACKAGES := $(strip $(subst $(newline),, $(ACCTEST_PACKAGES)))
Expand Down Expand Up @@ -199,7 +198,10 @@ jira-release-version: ## Update Jira version in a release

.PHONY: enable-autogen
enable-autogen: ## Enable use of autogen resources in the provider
make add-lines filename=./internal/provider/provider.go find="project.Resource," add="customdbroleapi.Resource,databaseuserapi.Resource,pushbasedlogexportapi.Resource,searchdeploymentapi.Resource,projectapi.Resource,resourcepolicyapi.Resource,"
$(eval filename := ./internal/provider/provider.go)
$(eval resources := $(shell ls -d internal/serviceapi/*/ | xargs -n1 basename))
$(foreach resource,$(resources),make add-lines filename=${filename} find="project.Resource," add="$(resource).Resource,\n";)
goimports -w ${filename}

.PHONY: delete-lines ${filename} ${delete}
delete-lines:
Expand All @@ -211,16 +213,14 @@ delete-lines:
.PHONY: add-lines ${filename} ${find} ${add}
add-lines:
rm -f file.tmp
sed 's/${find}/${find}${add}/' "${filename}" > "file.tmp"
sed 's/${find}/${add}${find}/' "${filename}" > "file.tmp"
mv file.tmp ${filename}
goimports -w ${filename}

.PHONY: change-lines ${filename} ${find} ${new}
change-lines:
rm -f file.tmp
sed 's/${find}/${new}/' "${filename}" > "file.tmp"
mv file.tmp ${filename}
goimports -w ${filename}

.PHONY: gen-purls
gen-purls: # Generate purls on linux os
Expand All @@ -236,4 +236,4 @@ upload-sbom: ## Upload SBOM

.PHONY: augment-sbom
augment-sbom: ## Augment SBOM
./scripts/augment-sbom.sh
./scripts/augment-sbom.sh