-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.dist.yaml
73 lines (62 loc) · 2.55 KB
/
Taskfile.dist.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
71
72
73
# This is the Taskfile responsible for managing taskit in any consuming repository
# More information is available at https://github.com/masterpointio/taskit
# This file is typically cloned into the repo as-is and any required edits should be made both here and in the taskit repo (if applicable)
# If any project specific changes are required, they should be made in a separate taskfiles/<module name>/Taskfile.yaml and then imported here.
version: "3"
includes:
taskit:
taskfile: .taskit/Taskfile.yaml
optional: true # Optional only until we have init'd taskit
aliases: [t]
local:
taskfile: taskfiles/Taskfile.yaml
optional: true # Optional as we may not have any local taskfiles
aliases: [l]
# Load our project specific variables from .env.taskit + .env.taskit-secrets
dotenv:
- .env.taskit
- .env.taskit-secrets
vars:
TASKIT_BRANCH: main
TASKIT_LOCAL_PATH: ""
tasks:
default:
desc: Initializes taskit
summary: |
This sets up taskit for this project by cloning the taskit project to .taskit/.
It also adds the taskit gitignore entries to the project's .gitignore file.
You can find more information at https://github.com/masterpointio/taskit
To set the branch that is cloned, set the `TASKIT_BRANCH`.
To work on taskit modules locally, set the `TASKIT_LOCAL_PATH` to the path of the local taskit repo.
This sets taskit to copy the files from the local repo instead of cloning the remote repo, whichs allows you to work on taskit locally.
deps: [clean]
silent: true
aliases: [init]
cmds:
- printf "🚀 Initializing taskit...\n\n"
- |
if [[ -f .gitignore ]]; then
echo "Adding taskit gitignore entries to existing .gitignore..."
else
echo "Creating .gitignore..."
touch .gitignore
fi
if ! grep -q ".taskit" .gitignore; then
echo -e "\n## Taskit files\n.taskit/\n.task/\n.snaplet/snapshots/\n.env.taskit-secrets\n" >> .gitignore
fi
- |
echo -e "\n"
if [[ -n "{{.TASKIT_LOCAL_PATH}}" ]]; then
echo "Copying taskit from local path..."
rsync -rq --exclude=.git --exclude= {{.TASKIT_LOCAL_PATH}}/ .taskit
else
echo "Downloading taskit from remote repo..."
git clone -b {{.TASKIT_BRANCH}} https://github.com/masterpointio/taskit.git .taskit/
fi
echo -e "\n\n⚡ Taskit successfully initialized! ⚡\n"
clean:
desc: Cleans up the project's Task setup
silent: true
cmds:
- rm -rf .taskit/
- mkdir -p .taskit