-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yaml
70 lines (63 loc) · 1.62 KB
/
Taskfile.yaml
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
version: '3'
dotenv:
- Taskfile.env
includes:
constructor:
taskfile: .constructor/Taskfile.yaml
dir: .constructor
optional: true
provisioner:
taskfile: .provisioner/Taskfile.yaml
dir: .provisioner
optional: true
tasks:
default:
silent: true
cmds:
- task --list
git_clone_if_not_exist:
vars:
REPO_URL: '{{.REPO_URL}}'
REPO_BRANCH: '{{.REPO_BRANCH}}'
REPO_DIR: '{{.REPO_DIR}}'
status:
- test -d "{{.REPO_DIR}}"
cmds:
- git clone --progress
--verbose
--single-branch
--branch '{{.REPO_BRANCH}}'
'{{.REPO_URL}}'
'{{.REPO_DIR}}'
git_checkout_or_pull:
deps:
- task: git_clone_if_not_exist
vars:
REPO_URL: '{{.REPO_URL}}'
REPO_BRANCH: '{{.REPO_BRANCH}}'
REPO_DIR: '{{.REPO_DIR}}'
vars:
REPO_DIR: '{{.REPO_DIR}}'
REPO_TAG: '{{.REPO_TAG}}'
cmds:
- cd '{{.REPO_DIR}}' &&
{{if eq .REPO_TAG ""}}
git pull
{{else}}
git checkout tags/{{.REPO_TAG}}
{{end}}
init:
desc: Initializes constructor and provisioner repositories
deps:
- task: git_checkout_or_pull
vars:
REPO_URL: '{{.CONSTRUCTOR_REPO_URL}}'
REPO_BRANCH: '{{.CONSTRUCTOR_REPO_BRANCH}}'
REPO_TAG: '{{.CONSTRUCTOR_REPO_TAG}}'
REPO_DIR: '{{.CONSTRUCTOR_REPO_DIR}}'
- task: git_checkout_or_pull
vars:
REPO_URL: '{{.PROVISIONER_REPO_URL}}'
REPO_BRANCH: '{{.PROVISIONER_REPO_BRANCH}}'
REPO_TAG: '{{.PROVISIONER_REPO_TAG}}'
REPO_DIR: '{{.PROVISIONER_REPO_DIR}}'