-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
73 lines (64 loc) · 2.47 KB
/
Taskfile.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
version: "3"
# .env file variables are available here, with the exception of `includes`,
# where externally defined environment variables and regular variables are available.
# It's therefore recommended to also source the .env file before running.
dotenv: [".env"]
vars:
# This environment variable must exist (i.e it's not enough that it's set in the .env file)
DEVENV: $DEVENV
includes:
aux: "{{.DEVENV}}/taskfiles/Taskfile.aux.yml"
git: "{{.DEVENV}}/taskfiles/Taskfile.git.yml"
lint: "{{.DEVENV}}/taskfiles/Taskfile.lint.yml"
format: "{{.DEVENV}}/taskfiles/Taskfile.format.yml"
silent: true
output: prefixed
tasks:
default:
desc: Clean, format, and lint the codebase
summary: |
This task cleans, formats, and lints the codebase.
cmds:
- task: aux:clean
- task: aux
- task: git
- task: format
- task: lint
dir: "{{.USER_WORKING_DIR}}"
docker:
desc: Run commands inside the Docker container
summary: |
This task allows you to run commands inside the Docker container.
Usage:
- `task docker` to launch the container and enter its shell
- `task docker -- --service-ports` to service ports
- `task docker -- task <task> -f` to run a task/command inside the container
cmds:
- docker rm -f devenv > /dev/null 2>&1 || true
- docker compose -f {{.DEVENV}}/docker-compose.yml build --build-arg CACHEBUST=$(date +%s) devenv
- docker compose -f {{.DEVENV}}/docker-compose.yml run --rm devenv {{.CLI_ARGS}}
interactive: true
dir: "{{.USER_WORKING_DIR}}"
tools:
desc: Run commands inside the Docker container
summary: |
This task allows you to run commands inside the Docker container.
Usage:
- `task tools` to launch the container and enter its shell
- `task tools -- task <task> -f` to run a task/command inside the container
cmds:
- docker rm -f tools > /dev/null 2>&1 || true
- docker compose -f {{.DEVENV}}/docker-compose.yml build --build-arg CACHEBUST=$(date +%s) tools
- docker compose -f {{.DEVENV}}/docker-compose.yml run --rm tools {{.CLI_ARGS}}
interactive: true
push:
desc: Push changes to the remote repository
summary: |
This task pushes changes to the remote repository.
Usage:
- `task push` for a default commit message
- `task push -- "My commit message"` for a custom commit message
cmds:
- task: git
- task: git:push
dir: "{{.USER_WORKING_DIR}}"