-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
78 lines (63 loc) · 1.81 KB
/
Taskfile.yml
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
version: '3'
vars:
GOOS: "{{default OS .GOOS}}"
MVNW: '{{if eq .GOOS "windows"}}mvnw.cmd{{else}}./mvnw{{end}}'
COMPOSE_FILE: "deployment/compose.yml"
SLEEP_CMD: '{{if eq .GOOS "windows"}}timeout{{else}}sleep{{end}}'
tasks:
default:
cmds:
- task: test
test:
deps: [format]
cmds:
- "{{.MVNW}} clean verify"
format:
cmds:
- "{{.MVNW}} spotless:apply"
build:
cmds:
- "{{.MVNW}} -pl catalog-service spring-boot:build-image -DskipTests"
- "{{.MVNW}} -pl order-service spring-boot:build-image -DskipTests"
- "{{.MVNW}} -pl notification-service spring-boot:build-image -DskipTests"
- "{{.MVNW}} -pl api-gateway spring-boot:build-image -DskipTests"
- "{{.MVNW}} -pl webapp spring-boot:build-image -DskipTests"
start_infra:
cmds:
- "docker compose -f {{.COMPOSE_FILE}} --profile infra up -d"
stop_infra:
cmds:
- "docker compose -f {{.COMPOSE_FILE}} --profile infra down -v"
restart_infra:
cmds:
- task: stop_infra
- task: sleep
- task: start_infra
start_monitoring:
cmds:
- "docker compose -f {{.COMPOSE_FILE}} --profile monitoring up -d"
stop_monitoring:
cmds:
- "docker compose -f {{.COMPOSE_FILE}} --profile monitoring down -v"
restart_monitoring:
cmds:
- task: stop_monitoring
- task: sleep
- task: start_monitoring
start:
deps: [build]
cmds:
- "docker compose -f {{.COMPOSE_FILE}} --profile app --profile infra --profile monitoring up -d"
stop:
cmds:
- "docker compose -f {{.COMPOSE_FILE}} --profile app --profile infra --profile monitoring down -v"
restart:
cmds:
- task: stop
- task: sleep
- task: start
sleep:
vars:
DURATION: "{{default 5 .DURATION}}"
cmds:
- "{{.SLEEP_CMD}} {{.DURATION}}"