github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/Makefile (about) 1 CF_DIAL_TIMEOUT ?= 15 2 NODES ?= 4 3 LC_ALL = "en_US.UTF-8" 4 5 CF_BUILD_VERSION ?= $$(cat ci/VERSION) 6 CF_BUILD_SHA ?= $$(git rev-parse --short HEAD) 7 CF_BUILD_DATE ?= $$(date -u +"%Y-%m-%d") 8 LD_FLAGS = "-w -s \ 9 -X code.cloudfoundry.org/cli/version.binaryVersion=$(CF_BUILD_VERSION) \ 10 -X code.cloudfoundry.org/cli/version.binarySHA=$(CF_BUILD_SHA) \ 11 -X code.cloudfoundry.org/cli/version.binaryBuildDate=$(CF_BUILD_DATE)" 12 GOSRC = $(shell find . -name "*.go" ! -name "*test.go" ! -name "*fake*" ! -path "./integration/*") 13 14 all : test build 15 16 build : out/cf 17 18 check-target-env : 19 ifndef CF_API 20 $(error CF_API is undefined) 21 endif 22 ifndef CF_PASSWORD 23 $(error CF_PASSWORD is undefined) 24 endif 25 26 clean : 27 rm -r $(wildcard out/*) 28 29 format : 30 go fmt ./... 31 32 fly-windows-experimental : check-target-env 33 CF_CLI_EXPERIMENTAL=true CF_TEST_SUITE=./integration/experimental fly -t ci execute -c ci/cli/tasks/integration-windows-oneoff.yml -i cli=./ 34 35 fly-windows-isolated : check-target-env 36 CF_TEST_SUITE=./integration/isolated fly -t ci execute -c ci/cli/tasks/integration-windows-oneoff.yml -i cli=./ 37 38 fly-windows-plugin : check-target-env 39 CF_TEST_SUITE=./integration/plugin fly -t ci execute -c ci/cli/tasks/integration-windows-oneoff.yml -i cli=./ 40 41 fly-windows-push : check-target-env 42 CF_TEST_SUITE=./integration/push fly -t ci execute -c ci/cli/tasks/integration-windows-oneoff.yml -i cli=./ 43 44 fly-windows-units : 45 fly -t ci execute -c ci/cli/tasks/units-windows.yml -i cli=./ -i cli-ci=./ 46 47 i18n : 48 $(PWD)/bin/i18n-checkup 49 50 i18n-extract-strings : 51 $(PWD)/bin/i18n-extract-strings 52 53 integration-cleanup : 54 $(PWD)/bin/cleanup-integration 55 56 integration-experimental : build integration-cleanup 57 CF_CLI_EXPERIMENTAL=true ginkgo -r -randomizeAllSpecs -slowSpecThreshold 60 -nodes $(NODES) integration/experimental 58 59 integration-global : build integration-cleanup 60 ginkgo -r -randomizeAllSpecs -slowSpecThreshold 60 integration/global 61 62 integration-isolated : build integration-cleanup 63 ginkgo -r -randomizeAllSpecs -slowSpecThreshold 60 -nodes $(NODES) integration/isolated 64 65 integration-plugin : build integration-cleanup 66 ginkgo -r -randomizeAllSpecs -slowSpecThreshold 60 -nodes $(NODES) integration/plugin 67 68 integration-push : build integration-cleanup 69 ginkgo -r -randomizeAllSpecs -slowSpecThreshold 60 -nodes $(NODES) integration/push 70 71 integration-tests : build integration-cleanup 72 ginkgo -r -randomizeAllSpecs -slowSpecThreshold 60 -nodes $(NODES) integration/isolated integration/push 73 ginkgo -r -randomizeAllSpecs -slowSpecThreshold 60 integration/global 74 make integration-cleanup 75 76 integration-tests-full : build integration-cleanup 77 ginkgo -r -randomizeAllSpecs -slowSpecThreshold 60 -nodes $(NODES) integration/isolated integration/push integration/plugin integration/experimental 78 ginkgo -r -randomizeAllSpecs -slowSpecThreshold 60 integration/global 79 make integration-cleanup 80 81 out/cf : $(GOSRC) 82 go build -o out/cf \ 83 -ldflags "-w \ 84 -s \ 85 -X code.cloudfoundry.org/cli/version.binaryVersion=$(CF_BUILD_VERSION) \ 86 -X code.cloudfoundry.org/cli/version.binarySHA=$(CF_BUILD_SHA) \ 87 -X code.cloudfoundry.org/cli/version.binaryBuildDate=$(CF_BUILD_DATE)" \ 88 . 89 90 out/cf-cli-_winx64.exe : $(GOSRC) 91 go get github.com/akavel/rsrc 92 rsrc -ico ci/installers/windows/cf.ico 93 GOARCH=amd64 GOOS=windows go build -tags="forceposix" -o out/cf-cli_winx64.exe -ldflags $(LD_FLAGS) . 94 rm rsrc.syso 95 96 out/cf-cli-_win32.exe : $(GOSRC) 97 go get github.com/akavel/rsrc 98 rsrc -ico ci/installers/windows/cf.ico 99 GOARCH=386 GOOS=windows go build -tags="forceposix" -o out/cf-cli_win32.exe -ldflags $(LD_FLAGS) . 100 rm rsrc.syso 101 102 test : units 103 104 units : format vet build 105 ginkgo -r -nodes $(NODES) -randomizeAllSpecs -randomizeSuites \ 106 api actor command types util version 107 @echo "\nSWEET SUITE SUCCESS" 108 109 units-full : format vet build 110 @rm -f $(wildcard fixtures/plugins/*.exe) 111 @ginkgo version 112 CF_HOME=$(PWD)/fixtures ginkgo -r -nodes $(NODES) -randomizeAllSpecs -randomizeSuites -skipPackage integration 113 @echo "\nSWEET SUITE SUCCESS" 114 115 version : 116 @echo $(CF_BUILD_VERSION)+$(CF_BUILD_SHA).$(CF_BUILD_DATE) 117 118 vet : 119 @echo "Vetting packages for potential issues..." 120 go tool vet -all -shadow=true ./api ./actor ./command ./integration ./types ./util ./version 121 122 .PHONY : all build clean i18n i18n-extract-strings format version vet 123 .PHONY : test units units-full integration integration-tests-full integration-cleanup integration-experimental integration-plugin integration-isolated integration-push 124 .PHONY : check-target-env fly-windows-experimental fly-windows-isolated fly-windows-plugin fly-windows-push