This repository has been archived by the owner on Feb 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
153 lines (104 loc) · 3.65 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
.PHONY: default static-switch generate docker-test docker-test-silent test-silent-connection \
clean-build test-and-build restart copy dev build create create-Darwin create-Linux \
quorum pantheon parity destroy test-ci tests-watch tests-silent quorum-test pantheon-test \
parity-test hammer-parity hammer-pantheon
##################
# Build targets #
##################
default: docker-test
static-switch:
cp terra/static.go.dist terra/static.go
generate: static-switch
go run builder/main.go
docker-test: clean generate
go test -cover -covermode=count -coverprofile=coverage.out ./...
docker-test-silent: clean-build generate
go test -cover -covermode=count -coverprofile=coverage.out ./... > dist/unit.log
test-silent-connection: clean-build
go test -cover -covermode=count -coverprofile=coverage.out ./connect/... > dist/unit.log
clean-build: clean
rm -rf mjolnir
clean:
rm -rf coverage.out
test-and-build: clean clean-build generate
go test -cover -covermode=count -coverprofile=coverage.out ./...
GOPROXY=https://proxy.golang.org CGO_ENABLED=0 go build -a -installsuffix cgo -o mjolnir
restart:
docker-compose down --remove-orphans
docker-compose up -d
copy:
cp docker-compose.override.yml.dist docker-compose.override.yml
cp .env.dist .env
dev: copy restart
docker-compose exec cli sh
TARGET := $(shell uname)
FILES := mjolnir
SUCCESS := $(shell if [ -f "$$FILE" ]; then echo "Installation is succesfull" else echo "Installation not successful"; fi )
create: create-$(TARGET)
create-Darwin: generate clean-build
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -o mjolnir
create-Linux: generate clean-build
CGO_ENABLED=0 go build -a -installsuffix cgo -o mjolnir
build: copy restart
docker-compose exec -T cli make create TARGET=$(TARGET)
$(SUCCESS)
destroy:
./mjolnir destroy examples/values-local.yml
rm -rf terraform.tfstate
test:
cp docker-compose.override.test.yml.dist docker-compose.override.yml
docker-compose up -d --no-deps cli-test
sleep 2
docker-compose exec -T cli-test make docker-test
tests-watch:
cp docker-compose.override.test.yml.dist docker-compose.override.yml
docker-compose up --no-deps cli-test
tests-silent:
cp docker-compose.override.test.yml.dist docker-compose.override.yml
docker-compose up -d --no-deps cli-test
sleep 2
docker-compose exec -T cli-test make docker-test-silent
#######################
# Deployment targets #
#######################
test-tps:
./scripts/automate_tps.sh
quorum:
./mjolnir apply quorum examples/values-local.yml
parity:
./mjolnir apply parity examples/values-local.yml
pantheon:
./mjolnir apply pantheon examples/values-local.yml
quorum-test: quorum test-tps
parity-test: parity test-tps
pantheon-test: pantheon test-tps
#########################
# "End to End" targets #
#########################
quorum-hammer: build quorum-test
parity-hammer: build parity-test
pantheon-hammer: build pantheon-test
deployment-test:
./scripts/deployment_time.sh
#######################
# Subcommand targets #
#######################
bastion:
./mjolnir bastion
ssh:
./mjolnir node
geth:
./mjolnir geth
node-info:
./mjolnir node-info
##################
# Travis targets #
##################
create-darwin-travis: generate clean-build
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -a -installsuffix cgo -o dist/${CLI_VERSION}/osx/mjolnir-osx
build-unix: generate
CGO_ENABLED=0 go build -a -installsuffix cgo -o dist/${CLI_VERSION}/unix/apollo-unix
build-mac: copy restart
docker-compose exec -T cli make create-darwin-travis
create-unix-travis: generate clean-build
CGO_ENABLED=0 go build -a -installsuffix cgo -o dist/${CLI_VERSION}/unix/mjolnir-osx