This repository has been archived by the owner on Aug 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
104 lines (94 loc) · 2.76 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
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
version: '3'
silent: true
dotenv: ['.env', '.env.example']
tasks:
default:
cmds:
- task --list
start:
desc: Start the local application environment
cmds:
- task: up
- task: install
- echo "Launched application at http://localhost:$APP_PORT"
suspend:
desc: Suspend the local application environment to maintain state for later
cmds:
- docker compose down
stop:
desc: Stop the local application environment and clean all state
cmds:
- docker compose down --volumes --rmi all --remove-orphans
logs:
desc: Stream local environment container output
cmds:
- docker compose logs -f
shell:
desc: Launch interactive shell for application container
cmds:
- task: exec
vars: {COMMAND: 'sh'}
check:
desc: Run application checks (code quality, tests)
cmds:
- task: composer
vars: {SCRIPT: "check"}
test:
desc: Run application tests
cmds:
- task: composer
vars: {SCRIPT: "test"}
install:
desc: Install php dependencies
cmds:
- task: composer
vars: {SCRIPT: "install"}
release:
desc: Tag new version of the application
summary: |
Tag a new version of the application against the current HEAD
VERSION is a required parameter which should be an un-prefixed Semantic
Version, e.g: 0.1.0.
To overwrite an existing tag on the local and remote, pass through the
`-f` flag to the underlying git command:
VERSION=0.1.0 task release -- -f
preconditions:
- sh: test $VERSION
msg: A VERSION parameter is required to create a new release
vars:
VERSION: '{{default "0.1.0" .VERSION}}'
cmds:
- git show --oneline -s
- |
git tag -sam ":tada: Version {{.VERSION}}" v{{.VERSION}} {{.CLI_ARGS}}
- git push origin v{{.VERSION}} {{.CLI_ARGS}}
up:
summary: |
Start local application environment
note: This is a command fragment for Taskfile composition.
cmds:
- docker compose up -d
composer:
summary: |
Run composer script on service
note: This is a command fragment for Taskfile composition.
vars:
SCRIPT: '{{default "" .SCRIPT}}'
cmds:
- task: exec
vars: {COMMAND: "composer {{.SCRIPT}}"}
exec:
summary: |
Run arbitrary command on service
TTY controls pseudo-tty allocation using for scripted execution of tasks.
note: This is a command fragment for Taskfile composition.
vars:
SERVICE: '{{default "app" .SERVICE}}'
COMMAND: '{{default "echo \"Hello, World!\"" .COMMAND}}'
TTY: '{{default "true" .TTY}}'
cmds:
- task: up
- |
docker compose exec \
{{if ne .TTY "true"}}-T{{end}} \
{{.SERVICE}} {{.COMMAND}}