-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
157 lines (127 loc) · 3.75 KB
/
Taskfile.yaml
File metadata and controls
157 lines (127 loc) · 3.75 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
version: 3
silent: true
includes:
scripts:
taskfile: ./.scripts
dir: ./.scripts
backend:
taskfile: ./backend
dir: ./backend
vars:
NENV: "node_modules"
SERVICES: "backend"
tasks:
_prettier:
internal: true
cmds:
- "{{.NENV}}/.bin/prettier {{.COMMAND}}"
_with_nvm:
internal: true
cmds:
- "source ${HOME}/.nvm/nvm.sh && nvm install && {{.COMMAND}}"
init:
desc: Initialize project environment
cmds:
- echo 'Installing node dependencies...'
- task: _with_nvm
vars: { COMMAND: "npm install" }
- echo 'Installing husky pre-commit...'
- task: _with_nvm
vars: { COMMAND: "npm run prepare" }
- echo 'Installing .scripts dependencies...'
- task: scripts:init
- for: { var: SERVICES, as: SERVICE }
task: "{{.SERVICE}}:init"
lint:
desc: Lint project
cmds:
- echo 'Running prettier checks...'
- task: _prettier
vars: { COMMAND: "--check ." }
- echo 'Running scripts checks...'
- task: scripts:lint
- for: { var: SERVICES, as: SERVICE }
task: "{{.SERVICE}}:lint"
- echo 'Running GHA checks...'
- GH_TOKEN="$(gh auth token)" zizmor .
lint-fix:
desc: Lint fix project
cmds:
- echo 'Running prettier fixes...'
- task: _prettier
vars: { COMMAND: "--write ." }
- echo 'Running scripts fixes...'
- task: scripts:lint-fix
- for: { var: SERVICES, as: SERVICE }
task: "{{.SERVICE}}:lint-fix"
- echo 'Running GHA checks...'
- GH_TOKEN="$(gh auth token)" zizmor .
test:
desc: Test project
cmds:
- echo 'Running tests...'
- for: { var: SERVICES, as: SERVICE }
task: "{{.SERVICE}}:test"
clean:
desc: Clean project environment
cmds:
- echo 'Cleaning node dependencies...'
- rm -rf {{.NENV}}
- echo 'Cleaning .scripts dependencies...'
- task: scripts:clean
- for: { var: SERVICES, as: SERVICE }
task: "{{.SERVICE}}:clean"
dependencies-update:
desc: Update dependencies
cmds:
- echo 'Updating node dependencies...'
- task: _with_nvm
vars: { COMMAND: "npm update" }
- echo 'Updating .scripts dependencies...'
- task: scripts:dependencies-update
- for: { var: SERVICES, as: SERVICE }
task: "{{.SERVICE}}:dependencies-update"
dependencies-check:
desc: Check dependencies
cmds:
- echo 'Checking node dependencies...'
- task: _with_nvm
vars: { COMMAND: "npm outdated" }
- task: _with_nvm
vars: { COMMAND: "npm audit" }
- echo 'Checking .scripts dependencies...'
- task: scripts:dependencies-check
- for: { var: SERVICES, as: SERVICE }
task: "{{.SERVICE}}:dependencies-check"
update-from-template:
desc: Update project from template
cmds:
- echo 'Updating project from template...'
- cookiecutter
--no-input
--overwrite-if-exists
--output-dir ../
{{.TEMPLATE_PATH}}
project_name='Github Watcher'
project_slug='github-watcher'
node_version='v21.5.0'
github_workflow_runs_on='ubuntu-latest'
owner_name='Dmitry Ovsiannikov'
owner_github_login='ovsds'
scripts='true'
services='backend'
with_python='true'
with_cookiecutter='false'
with_trivy='true'
with_zizmor='true'
with_docker='false'
with_build='true'
vars:
TEMPLATE_PATH: '{{.TEMPLATE_PATH | default "https://github.com/ovsds/template-repository"}}'
configure-builder:
desc: Configure buildx for multi-arch builds
cmds:
- echo 'Configuring buildx...'
- docker buildx create
--driver docker-container
--use