-
-
Notifications
You must be signed in to change notification settings - Fork 155
/
Makefile
69 lines (51 loc) · 1.75 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
OUTPUT_DIR ?=./build
DIST_DIR ?=./dist
DOCKER_REMOTE_HOST_ADDR ?= "127.0.0.1"
DOCKER_REMOTE_HOST_USER ?= $(whoami)
lint:
docker pull golangci/golangci-lint
docker run --rm -v $(CURDIR):/app -w /app golangci/golangci-lint golangci-lint run -v
generate:
go get -u github.com/gobuffalo/packr/v2/...
go get -u github.com/gobuffalo/packr/v2/packr2
packr2
b:
go build -ldflags="-s -w" -o ${OUTPUT_DIR}/fx fx.go
build:
go build -ldflags="-s -w" -o ${OUTPUT_DIR}/fx fx.go
pull:
./scripts/pull.sh
cross: generate
goreleaser --snapshot --skip-publish --skip-validate
clean:
rm -rf ${OUTPUT_DIR}
rm -rf ${DIST_DIR}
unit-test:
./scripts/coverage.sh
cli-test-ci:
./scripts/test_cli.sh 'js'
cli-test:
./scripts/test_cli.sh 'js rb py go java d pl php'
http-test:
./scripts/http_test.sh
zip:
zip -r images.zip images/
.PHONY: test build start list clean generate
start_docker_infra:
docker build -t fx-docker-infra -f test/Dockerfile ./test
docker run --rm --name fx-docker-infra -p 2222:22 -v /var/run/docker.sock:/var/run/docker.sock -d fx-docker-infra
test_docker_infra:
CICD=true SSH_PORT=2222 SSH_KEY_FILE=./test/id_rsa ./build/fx infra create --name docker-local -t docker --host root@127.0.0.1
stop_docker_infra:
docker stop fx-docker-infra
start_k3s_infra:
multipass launch --name k3s-master --cpus 1 --mem 512M --disk 3G --cloud-init ./test/k3s/ssh-cloud-init.yaml
multipass launch --name k3s-worker1 --cpus 1 --mem 512M --disk 3G --cloud-init ./test/k3s/ssh-cloud-init.yaml
multipass launch --name k3s-worker2 --cpus 1 --mem 512M --disk 3G --cloud-init ./test/k3s/ssh-cloud-init.yaml
test_k3s_infra:
./scripts/test_k3s_infra.sh
stop_k3s_infra:
multipass delete k3s-master
multipass delete k3s-worker1
multipass delete k3s-worker2
multipass purge