This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
108 lines (87 loc) · 3.21 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2018, Backstage <backstage@corp.globo.com>
COMPOSE := $(shell command -v docker-compose 2> /dev/null)
YARN := $(shell command -v yarn 2> /dev/null)
setup:
@go get -u github.com/wadey/gocovmerge
@go get -u github.com/onsi/ginkgo
@dep ensure
ifdef YARN
@yarn install
else
@npm install
endif
build:
@go build $(PACKAGES)
@go build -o ./bin/fastlane-cmd main.go
test: unit test-coverage-func
clear-coverage-profiles:
@find . -name '*.coverprofile' -delete
unit: clear-coverage-profiles unit-run gather-unit-profiles
unit-run:
#@LOGXI="*=ERR,dat:sqlx=OFF,dat=OFF" ginkgo -cover -r -randomizeAllSpecs -randomizeSuites -skipMeasurements ${TEST_PACKAGES}
@ginkgo -cover -r -randomizeAllSpecs -randomizeSuites -skipMeasurements ${TEST_PACKAGES}
gather-unit-profiles:
@mkdir -p _build
@echo "mode: count" > _build/coverage-unit.out
@bash -c 'for f in $$(find . -name "*.coverprofile"); do tail -n +2 $$f >> _build/coverage-unit.out; done'
merge-profiles:
@mkdir -p _build
@gocovmerge _build/*.out > _build/coverage-all.out
test-coverage-func coverage-func: merge-profiles
@echo
@echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
@echo "Functions NOT COVERED by Tests"
@echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
@go tool cover -func=_build/coverage-all.out | egrep -v "100.0[%]"
test-coverage-html coverage-html: merge-profiles
@go tool cover -html=_build/coverage-all.out
enqueue:
@go run main.go enqueue -v3
.PHONY: static
static:
@cd static && go-bindata -o ../core/static.go -pkg core ./*
@cd third-party/backstage-stack && go-bindata -o ../../stack/stack.go -pkg stack ./*
clean: clear-coverage-profiles
build-linux-64:
@mkdir -p ./bin
@echo "Building for linux-x86_64..."
@env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o ./bin/fastlane-cmd-linux-x86_64
@chmod +x bin/*
cross:
@mkdir -p ./bin
@echo "Building for linux-i386..."
@env GOOS=linux GOARCH=386 go build -o ./bin/fastlane-cmd-linux-i386
$(MAKE) build-linux-64
@echo "Building for darwin-i386..."
@env GOOS=darwin GOARCH=386 go build -o ./bin/fastlane-cmd-darwin-i386
@echo "Building for darwin-x86_64..."
@env GOOS=darwin GOARCH=amd64 go build -o ./bin/fastlane-cmd-darwin-x86_64
@chmod +x bin/*
deps-build:
ifdef COMPOSE
@echo "Starting dependencies (rebuilding)..."
@docker-compose --project-name fastlane-cmd -f ./docker-compose.yml rm -f
@docker-compose --project-name fastlane-cmd -f ./docker-compose.yml pull
@docker-compose --project-name fastlane-cmd -f ./docker-compose.yml up --build -d --remove-orphans
@echo "Dependencies started successfully."
endif
deps:
ifdef COMPOSE
@echo "Starting dependencies..."
@git submodule update --remote
@docker-compose --project-name fastlane-cmd -f ./docker-compose.yml rm -f
@docker-compose --project-name fastlane-cmd -f ./docker-compose.yml up -d --remove-orphans
@echo "Dependencies started successfully."
endif
stop-deps:
ifdef COMPOSE
@echo "Stopping dependencies..."
@docker-compose --project-name fastlane-cmd -f ./docker-compose.yml stop
@docker-compose --project-name fastlane-cmd -f ./docker-compose.yml rm -f
endif
ps:
ifdef COMPOSE
@docker-compose --project-name fastlane-cmd -f ./docker-compose.yml ps
endif