Skip to content

Commit

Permalink
Add Makefile PHONIES
Browse files Browse the repository at this point in the history
  • Loading branch information
Rasheed Abdul-Aziz committed Sep 27, 2021
1 parent 5b17502 commit 6602094
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
.PHONY: build
build: gen-objects gen-manifests
go build -o build/cartographer ./cmd/cartographer

.PHONY: run
run: build
build/cartographer

.PHONY: gen-objects
gen-objects:
go run sigs.k8s.io/controller-tools/cmd/controller-gen \
object \
paths=./pkg/apis/v1alpha1

.PHONY: gen-manifests
gen-manifests:
go run sigs.k8s.io/controller-tools/cmd/controller-gen \
crd \
Expand All @@ -16,11 +22,13 @@ gen-manifests:
-f ./hack/boilerplate.go.txt \
config/crd/bases

.PHONY: test-gen-objects
test-gen-objects:
go run sigs.k8s.io/controller-tools/cmd/controller-gen \
object \
paths=./tests/integration/pipeline_service/testapi

.PHONY: test-gen-manifests
test-gen-manifests:
go run sigs.k8s.io/controller-tools/cmd/controller-gen \
crd \
Expand All @@ -30,43 +38,57 @@ test-gen-manifests:
-f ./hack/boilerplate.go.txt \
./tests/integration/pipeline_service/testapi/crds

.PHONY: clean-fakes
clean-fakes:
find . -type d -name '*fakes' | xargs -n1 rm -r

.PHONY: generate
generate: clean-fakes
go generate ./...

.PHONY: test-unit
test-unit:
go run github.com/onsi/ginkgo/ginkgo -r pkg

.PHONY: test-integration
test-integration:
go run github.com/onsi/ginkgo/ginkgo -r tests/integration

.PHONY: test-kuttl
test-kuttl: build
if [ -n "$$focus" ]; then kubectl kuttl test --test $$(basename $(focus)); else kubectl kuttl test; fi

.PHONY: list-kuttl
list-kuttl:
(cd tests/kuttl && find . -maxdepth 1 -type d)

.PHONY: test-kuttl-kind
test-kuttl-kind: build
kubectl kuttl test --start-kind=true --start-control-plane=false --artifacts-dir=/dev/null

.PHONY: test
test: test-unit test-kuttl test-integration

.PHONY: install
install:
kapp deploy --file ./config/crd --app cartographer-controller --yes --diff-changes

.PHONY: uninstall
uninstall:
kapp delete --app cartographer-controller --yes

.PHONY: coverage
coverage:
go test -coverprofile=coverage.out ./pkg/...
go tool cover -func=./coverage.out
go tool cover -html=coverage.out -o coverage.html
open coverage.html

.PHONY: lint
lint: copyright
go run github.com/golangci/golangci-lint/cmd/golangci-lint --config lint-config.yaml run

.PHONY: copyright
copyright:
go run github.com/google/addlicense \
-f ./hack/boilerplate.go.txt \
Expand Down

0 comments on commit 6602094

Please sign in to comment.