-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaskfile.yml
49 lines (42 loc) · 1.01 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
version: '3'
dotenv:
- .env
tasks:
# default:
# desc: 服務資訊
# cmds:
# - task: .compose-run
# vars:
# COMPOSE_CMD: "config"
traefik:
desc: 啟動 traefik
cmds:
- docker-compose --project-directory=traefik -f $BASE_NETWORK_YAML -f traefik/docker-compose.yml up -d
start:
desc: 啟動服務
cmds:
- task: .compose-run
vars:
COMPOSE_CMD: "up -d"
stop:
desc: 停止服務
cmds:
- task: .compose-run
vars:
COMPOSE_CMD: "stop"
down:
desc: 結束服務
cmds:
- task: .compose-run
vars:
COMPOSE_CMD: "down"
.compose-run:
internal: true
desc: compose 指令
vars:
# COMPOSE_CMD: "config"
SERVICE_NAME: "{{.CLI_ARGS}}"
COMPOSE_FILE: "{{.SERVICE_NAME}}/docker-compose.yml"
NETWORK_FILE: "$BASE_NETWORK_YAML"
cmds:
- docker-compose --project-directory={{.SERVICE_NAME}} -f {{.NETWORK_FILE}} -f {{.COMPOSE_FILE}} {{.COMPOSE_CMD}}