-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yml
More file actions
56 lines (47 loc) · 1.72 KB
/
taskfile.yml
File metadata and controls
56 lines (47 loc) · 1.72 KB
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
version: '3'
silent: true
tasks:
default:
cmds:
- task -l
test:
desc: Lancer les tests Go avec gotestsum
cmds:
- gotestsum -f github-actions -- -v $(go list ./... | grep -vE "vendor") -coverprofile=coverage.out -covermode=atomic
test:api:
desc: Benchmark l'api (ideal pour voir les metrics sur grafana)
cmds:
- tests/run.sh
run:bin:
deps: [build:bin]
desc: Lancer l'application Go sans Docker
cmds:
- .build/$(basename $(pwd))
build:bin:
desc: Construire les binaires Go
cmds:
- swag init -d ./api -g fizzbuzz/main.go -o ./api/internal/docs/generated
- go generate ./...
- CGO_ENABLED=0 go build -trimpath -buildvcs=false -tags netgo -ldflags "-s -w -extldflags '-static'" -o .build/fizzbuzz api/fizzbuzz/main.go
build:docker:local:
desc: Construire l'image Docker en local
cmds:
- swag init -d ./api -g fizzbuzz/main.go -o ./api/internal/docs/generated
- go generate ./...
- GOOS=linux CGO_ENABLED=0 go build -trimpath -buildvcs=false -tags netgo -ldflags "-s -w -extldflags '-static'" -o .build/fizzbuzz api/fizzbuzz/main.go
- docker build -t kodmain/fizzbuzz -f .github/ci/dockerfiles/fizzbuzz.local.Dockerfile .
deploy:local:
deps: [build:docker:local]
dir: deploy/local
desc: Déployer l'application en local avec la release sur la machine
cmds:
- terraform init -upgrade
- terraform apply -auto-approve
deploy:release:
dir: deploy/local
desc: Déployer l'application en local avec la release sur github
cmds:
- docker rm $(docker ps -aq) -f || true
- docker system prune -af --volumes
- terraform init -upgrade
- terraform apply -auto-approve