-
Notifications
You must be signed in to change notification settings - Fork 3
/
Taskfile.dist.yml
75 lines (64 loc) · 2.12 KB
/
Taskfile.dist.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
version: '3'
dotenv: ['.env.local', '.env', '.env.dist'] # first file takes precedence
includes:
git:
taskfile: ./GitTasks.yml
internal: true
tasks:
default:
cmds:
- "'{{.TASK_EXE}}' --list"
.env:
desc: Initiate the .env file
cmds:
- if test -f "{{.TASK}}.bck"; then mv "{{.TASK}}.bck" "{{.TASK}}"; else cp "{{.TASK}}.dist" "{{.TASK}}"; fi
generates:
- "{{.TASK}}"
status:
- test -f "{{.TASK}}"
silent: true
clone:
required:
vars: [ NINETOFIVER_URL, NINETOFIVER_DIRECTORY, NINETOFIVER_BRANCH, YAYATA_URL, YAYATA_DIRECTORY, YAYATA_BRANCH ]
deps:
- task: git:clone
vars: { URL: '{{.NINETOFIVER_URL}}', DIRECTORY: '{{.NINETOFIVER_DIRECTORY}}', BRANCH: '{{.NINETOFIVER_BRANCH}}' }
- task: git:clone
vars: { URL: '{{.YAYATA_URL}}', DIRECTORY: '{{.YAYATA_DIRECTORY}}', BRANCH: '{{.YAYATA_BRANCH}}' }
pull:
required:
vars: [ NINETOFIVER_URL, NINETOFIVER_DIRECTORY, NINETOFIVER_BRANCH, YAYATA_URL, YAYATA_DIRECTORY, YAYATA_BRANCH ]
deps:
- task: git:pull
vars: { URL: '{{.NINETOFIVER_URL}}', DIRECTORY: '{{.NINETOFIVER_DIRECTORY}}', BRANCH: '{{.NINETOFIVER_BRANCH}}' }
- task: git:pull
vars: { URL: '{{.YAYATA_URL}}', DIRECTORY: '{{.YAYATA_DIRECTORY}}', BRANCH: '{{.YAYATA_BRANCH}}' }
prepare:
cmds:
- task: .env
- "'{{.TASK_EXE}}' clone" # Make sure to read the .env file before cloning
start:
deps:
- task: prepare
cmds:
- cd '{{.NINETOFIVER_DIRECTORY}}' && '{{.TASK_EXE}}' start
- cd '{{.YAYATA_DIRECTORY}}' && '{{.TASK_EXE}}' start
stop:
deps:
- task: prepare
cmds:
- cd '{{.NINETOFIVER_DIRECTORY}}' && '{{.TASK_EXE}}' stop
- cd '{{.YAYATA_DIRECTORY}}' && '{{.TASK_EXE}}' stop
remove:
required:
vars: [ NINETOFIVER_DIRECTORY, YAYATA_DIRECTORY ]
deps:
- task: git:remove
vars: { DIRECTORY: '{{.NINETOFIVER_DIRECTORY}}' }
- task: git:remove
vars: { DIRECTORY: '{{.YAYATA_DIRECTORY}}' }
clean:
desc: Clean up
cmds:
- task: remove
- if test -f .env; then mv .env .env.bck; fi