forked from vmware-tanzu/velero
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request vmware-tanzu#243 from kaovilai/1.0-ci
Add `make -f Makefile.prow ci` that can be run in prow
- Loading branch information
Showing
2 changed files
with
44 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
GOFLAGS="-mod=mod" | ||
# emulate as close as possible upstream ci target | ||
# upstream ci target: verify-modules verify all test | ||
# we skip verify for now | ||
# we only need to modify test, all to avoid docker usage | ||
.PHONY: ci | ||
ci: | ||
GOFLAGS=$(GOFLAGS) make verify-modules | ||
make -f Makefile.prow all test | ||
|
||
.PHONY: all | ||
all: | ||
GOFLAGS=$(GOFLAGS) make local | ||
GOFLAGS=$(GOFLAGS) BIN=velero-restic-restore-helper make local | ||
|
||
.PHONY: test | ||
# our test is modified to avoid docker usage | ||
test: hack-docker | ||
@echo Using KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) | ||
KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) GOFLAGS=$(GOFLAGS) hack/test.sh | ||
|
||
.PHONY: hack-docker | ||
# emulate docker environment from hack/build-image/Dockerfile | ||
hack-docker: envtest | ||
|
||
GOPATH:=$(shell go env GOPATH) | ||
KUBEBUILDER_ASSETS:=$(shell $(GOPATH)/bin/setup-envtest use -p path) | ||
# if KUBEBUILDER_ASSETS contains space, escape it | ||
KUBEBUILDER_ASSETS:=$(shell echo $(KUBEBUILDER_ASSETS) | sed 's/ /\\ /g') | ||
.PHONY: envtest | ||
envtest: $(GOPATH)/bin/setup-envtest | ||
$(GOPATH)/bin/setup-envtest use -p path | ||
|
||
$(GOPATH)/bin/setup-envtest: | ||
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest |