-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
210 lines (199 loc) · 5.43 KB
/
Taskfile.yml
File metadata and controls
210 lines (199 loc) · 5.43 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# yaml-language-server: $schema=https://taskfile.dev/schema.json
## NOTE: Don't update this file if you are syncing via vendir.
## Create/update ./Taskfile.custom.yml instead!
version: "3"
silent: true
vars:
TARGET:
sh: 'echo "${TARGET:-"default"}"'
PROFILE:
sh: 'echo "${PROFILE:-"default"}"'
PROJECT:
sh: 'echo "$(basename $(pwd))"'
PYTHON_VENV_PATH: "{{.ROOT_DIR}}/.venv"
LOCAL_BIN_PATH: "{{.PYTHON_VENV_PATH}}/bin"
BUILD_DATE:
sh: "date '+%Y-%m-%d-%H:%M:%S'"
BUILD_DATE_SHORT:
sh: "date '+%Y-%m-%d-%H%M%S'"
GIT_LATEST_TAG:
sh: 'git tag -l 2>/dev/null | sort -r -V | head -n 1 2>/dev/null || echo "not a git repo"'
TERM: screen-256color
DOCS_PATH: "{{.ROOT_DIR}}/docs"
SCRIPT_PATH: "{{.ROOT_DIR}}/scripts"
VERSION: '{{default "unknown" .GIT_LATEST_TAG}}'
SSH_AUTHORIZED_KEY: ~/.ssh/id_rsa.pub
SSH_HOST_KEY:
sh: echo "~/.ssh/${HOST}-id_rsa.pub"
AGE_CONFIG_PATH: "~/.config/sops/age"
# env:
# AUTHOR_NAME: '{{default "{{.AUTHOR_NAME}}" "git" }}'
# AUTHOR_EMAIL: '{{default "{{.AUTHOR_EMAIL}}" "git@nowhere" }}'
dotenv:
- ".SECRETS.env"
includes:
variables:
taskfile: ./Taskfile.vars.yml
optional: true
# agebox:
# taskfile: ./tasks/Taskfile.agebox.yml
# optional: true
# ansible:
# taskfile: ./tasks/Taskfile.ansible.yml
# optional: true
# argocd:
# taskfile: ./tasks/Taskfile.argocd.yml
# optional: true
# aws:
# taskfile: ./tasks/Taskfile.aws.yml
# optional: true
# cdk:
# taskfile: ./tasks/Taskfile.cdk.yml
# optional: true
# chatgpt:
# taskfile: ./tasks/Taskfile.chatgpt.yml
# optional: true
# cloudflared:
# taskfile: ./tasks/Taskfile.cloudflared.yml
# optional: true
# cluster:
# taskfile: ./tasks/Taskfile.cluster.yml
# optional: true
# docker:
# taskfile: ./tasks/Taskfile.docker.yml
# optional: true
# dotnet:
# taskfile: ./tasks/Taskfile.dotnet.yml
# optional: true
# dynamodb:
# taskfile: ./tasks/Taskfile.dynamodb.yml
# optional: true
# flux:
# taskfile: ./tasks/Taskfile.flux.yml
# optional: true
# format:
# taskfile: ./tasks/Taskfile.format.yml
# optional: true
# github:
# taskfile: ./tasks/Taskfile.github.yml
# optional: true
# gitlab:
# taskfile: ./tasks/Taskfile.gitlab.yml
# optional: true
# git:
# taskfile: ./tasks/Taskfile.git.yml
# optional: true
# go:
# taskfile: ./tasks/Taskfile.go.yml
# optional: true
# helmfile:
# taskfile: ./tasks/Taskfile.helmfile.yml
# optional: true
# hugo:
# taskfile: ./tasks/Taskfile.hugo.yml
# optional: true
# kube:
# taskfile: ./tasks/Taskfile.kube.yml
# optional: true
# lint:
# taskfile: ./tasks/Taskfile.lint.yml
# optional: true
# openapi:
# taskfile: ./tasks/Taskfile.openapi.yml
# optional: true
# pi:
# taskfile: ./tasks/Taskfile.pi.yml
# optional: true
# precommit:
# taskfile: ./tasks/Taskfile.precommit.yml
# optional: true
# python:
# taskfile: ./tasks/Taskfile.python.yml
# optional: true
# sops:
# taskfile: ./tasks/Taskfile.sops.yml
# optional: true
# steampipe:
# taskfile: ./tasks/Taskfile.steampipe.yml
# optional: true
# terraform:
# taskfile: ./tasks/Taskfile.terraform.yml
# optional: true
# vault:
# taskfile: ./tasks/Taskfile.vault.yml
# optional: true
# workspace:
# taskfile: ./tasks/Taskfile.workspace.yml
# optional: true
workstation:
taskfile: ./tasks/Taskfile.workstation.yml
optional: true
system:
taskfile: ./tasks/Taskfile.system.yml
optional: true
custom:
taskfile: ./Taskfile.custom.yml
optional: true
tasks:
default:
cmds:
- |
task -l
show:
desc: Show task variables
cmds:
- |
echo "ROOT_PATH: {{.ROOT_DIR}}"
echo "PROFILE: {{.PROFILE}}"
echo "PROJECT: {{.PROJECT}}"
echo "VERSION: {{.VERSION}}"
echo "OS: {{OS}}"
echo "ARCH: {{ARCH}}"
echo "LOCAL_BIN_PATH: {{.LOCAL_BIN_PATH}}"
echo "DOCS_PATH: {{.DOCS_PATH}}"
echo "PYTHON_VENV_PATH: {{.PYTHON_VENV_PATH}}"
echo "SCRIPT_PATH: {{.SCRIPT_PATH}}"
echo "BUILD_DATE: {{.BUILD_DATE}}"
echo "GIT_LATEST_TAG: {{.GIT_LATEST_TAG}}"
show:all:
desc: Show all variables for task namespaces
cmds:
- |
echo "## Show ##";
task show
echo ""
for taskitem in $(task -l | cut -d " " -f2 | grep show | sed 's/.$//'); do
if [[ "$taskitem" != "show:all" ]]; then
echo "## Show - ${taskitem} ##";
task $taskitem;
echo "";
fi
done
list:
desc: List tasks by namespace (task list -- <namespace>)
cmds:
- |
if [[ "{{.CLI_ARGS}}" != "" ]]; then
task -l | grep {{default "" .CLI_ARGS}}
else
task -l
fi
toc:
desc: Update the table of contents in README.md
cmds:
- |
source {{.LOCAL_BIN_PATH}}/activate
mdtoc README.md
secrets:
desc: Create template .SECRETS file if one does not already exist.
cmds:
- cp ./config/.SECRETS.example.env ./.SECRETS.env
status:
- "test -f .SECRETS.env"
autocomplete:
desc: Setup task autocomplete (zsh)
cmds:
- sudo curl https://raw.githubusercontent.com/go-task/task/main/completion/zsh/_task \
-o /usr/local/share/zsh/site-functions/_task
status:
- "test -f /usr/local/share/zsh/site-functions/_task"