@@ -18,86 +18,122 @@ The `version:` key on Taskfile accepts a semver string, so either `2`, `2.0` or
18
18
` 2.1 ` features, but if you choose to use ` 2 ` , then any ` 2.x.x ` features will be
19
19
available, but not ` 3.0.0+ ` .
20
20
21
- ## Version 1
21
+ ## Version 3 ![ latest ] ( https://img.shields.io/badge/latest-brightgreen )
22
22
23
- > NOTE: Taskfiles in version 1 are not supported on Task >= v3.0.0 anymore.
23
+ These are some major changes done on ` v3 ` :
24
24
25
- In the first version of the ` Taskfile ` , the ` version: ` key was not available,
26
- because the tasks was in the root of the YAML document. Like this:
25
+ - Task's output will now be colored
26
+ - Added support for ` .env ` like files
27
+ - Added ` label: ` setting to task so one can override how the task name appear in
28
+ the logs
29
+ - A global ` method: ` was added to allow setting the default method, and Task's
30
+ default changed to ` checksum `
31
+ - Two magic variables were added when using ` status: ` : ` CHECKSUM ` and
32
+ ` TIMESTAMP ` which contains, respectively, the md5 checksum and greatest
33
+ modification timestamp of the files listed on ` sources: `
34
+ - Also, the ` TASK ` variable is always available with the current task name
35
+ - CLI variables are always treated as global variables
36
+ - Added ` dir: ` option to ` includes ` to allow choosing on which directory an
37
+ included Taskfile will run:
27
38
28
39
``` yaml
29
- echo :
30
- cmds :
31
- - echo "Hello, World!"
40
+ includes :
41
+ docs :
42
+ taskfile : ./docs
43
+ dir : ./docs
32
44
` ` `
33
45
34
- The variable priority order was also different :
46
+ - Implemented short task syntax. All below syntaxes are equivalent :
35
47
36
- 1. Call variables
37
- 2. Environment
38
- 3. Task variables
39
- 4. ` Taskvars.yml` variables
48
+ ` ` ` yaml
49
+ version : ' 3'
40
50
41
- # # Version 2.0
51
+ tasks :
52
+ print :
53
+ cmds :
54
+ - echo "Hello, World!"
55
+ ` ` `
42
56
43
- At version 2, we introduced the `version:` key, to allow us to evolve Task with
44
- new features without breaking existing Taskfiles. The new syntax is as follows :
57
+ ` ` ` yaml
58
+ version : ' 3'
59
+
60
+ tasks :
61
+ print :
62
+ - echo "Hello, World!"
63
+ ` ` `
45
64
46
65
` ` ` yaml
47
- version: '2 '
66
+ version : ' 3 '
48
67
49
68
tasks :
50
- echo:
51
- cmds:
52
- - echo "Hello, World!"
69
+ print : echo "Hello, World!"
53
70
` ` `
54
71
55
- Version 2 allows you to write global variables directly in the Taskfile, if you
56
- don't want to create a `Taskvars.yml` :
72
+ - There was a major refactor on how variables are handled. They're now easier to
73
+ understand. The ` expansions:` setting was removed as it became unnecessary.
74
+ This is the order in which Task will process variables, each level can see the
75
+ variables set by the previous one and override those.
76
+ - Environment variables
77
+ - Global + CLI variables
78
+ - Call variables
79
+ - Task variables
80
+
81
+ # # Version 2.6
82
+
83
+ :::caution
84
+
85
+ v2 schema support is [deprecated][deprecate-version-2-schema] and will be
86
+ removed in a future release.
87
+
88
+ :: :
89
+
90
+ Version 2.6 comes with `preconditions` stanza in tasks.
57
91
58
92
` ` ` yaml
59
93
version: '2'
60
94
61
- vars:
62
- GREETING: Hello, World!
63
-
64
95
tasks:
65
- greet:
96
+ upload_environment:
97
+ preconditions:
98
+ - test -f .env
66
99
cmds:
67
- - echo "{{.GREETING}}"
100
+ - aws s3 cp .env s3://myenvironment
68
101
` ` `
69
102
70
- The variable priority order changed to the following :
103
+ Please check the [documentation][includes]
71
104
72
- 1. Task variables
73
- 2. Call variables
74
- 3. Taskfile variables
75
- 4. Taskvars file variables
76
- 5. Environment variables
105
+ [output] : usage.md#output-syntax
106
+ [ignore_errors] : usage.md#ignore-errors
107
+ [includes] : usage.md#including-other-taskfiles
77
108
78
- A new global option was added to configure the number of variables expansions
79
- (which default to 2) :
109
+ # # Version 2.2
80
110
81
- ` ` ` yaml
82
- version: '2'
111
+ :::caution
83
112
84
- expansions: 3
113
+ v2 schema support is [deprecated][deprecate-version-2-schema] and will be
114
+ removed in a future release.
85
115
86
- vars:
87
- FOO: foo
88
- BAR: bar
89
- BAZ: baz
90
- FOOBAR: '{{.FOO}}{{.BAR}}'
91
- FOOBARBAZ: '{{.FOOBAR}}{{.BAZ}}'
116
+ :: :
92
117
93
- tasks:
94
- default:
95
- cmds:
96
- - echo "{{.FOOBARBAZ}}"
118
+ Version 2.2 comes with a global `includes` options to include other Taskfiles :
119
+
120
+ ` ` ` yaml
121
+ version: '2'
122
+
123
+ includes:
124
+ docs: ./documentation # will look for ./documentation/Taskfile.yml
125
+ docker: ./DockerTasks.yml
97
126
` ` `
98
127
99
128
# # Version 2.1
100
129
130
+ :::caution
131
+
132
+ v2 schema support is [deprecated][deprecate-version-2-schema] and will be
133
+ removed in a future release.
134
+
135
+ :: :
136
+
101
137
Version 2.1 includes a global `output` option, to allow having more control over
102
138
how commands output are printed to the console (see [documentation][output] for
103
139
more info) :
@@ -134,95 +170,95 @@ tasks:
134
170
ignore_error: true
135
171
` ` `
136
172
137
- # # Version 2.2
173
+ # # Version 2.0
138
174
139
- Version 2.2 comes with a global `includes` options to include other Taskfiles :
175
+ :::caution
176
+
177
+ v2 schema support is [deprecated][deprecate-version-2-schema] and will be
178
+ removed in a future release.
179
+
180
+ :: :
181
+
182
+ At version 2, we introduced the `version:` key, to allow us to evolve Task with
183
+ new features without breaking existing Taskfiles. The new syntax is as follows :
140
184
141
185
` ` ` yaml
142
186
version: '2'
143
187
144
- includes:
145
- docs: ./documentation # will look for ./documentation/Taskfile.yml
146
- docker: ./DockerTasks.yml
188
+ tasks:
189
+ echo:
190
+ cmds:
191
+ - echo "Hello, World!"
147
192
` ` `
148
193
149
- # # Version 2.6
150
-
151
- Version 2.6 comes with `preconditions` stanza in tasks.
194
+ Version 2 allows you to write global variables directly in the Taskfile, if you
195
+ don't want to create a `Taskvars.yml` :
152
196
153
197
` ` ` yaml
154
198
version: '2'
155
199
200
+ vars:
201
+ GREETING: Hello, World!
202
+
156
203
tasks:
157
- upload_environment:
158
- preconditions:
159
- - test -f .env
204
+ greet:
160
205
cmds:
161
- - aws s3 cp .env s3://myenvironment
206
+ - echo "{{.GREETING}}"
162
207
` ` `
163
208
164
- Please check the [documentation][includes]
165
-
166
- [output] : usage.md#output-syntax
167
- [ignore_errors] : usage.md#ignore-errors
168
- [includes] : usage.md#including-other-taskfiles
169
-
170
- # # Version 3
209
+ The variable priority order changed to the following :
171
210
172
- These are some major changes done on `v3` :
211
+ 1. Task variables
212
+ 2. Call variables
213
+ 3. Taskfile variables
214
+ 4. Taskvars file variables
215
+ 5. Environment variables
173
216
174
- - Task's output will now be colored
175
- - Added support for `.env` like files
176
- - Added `label:` setting to task so one can override how the task name appear in
177
- the logs
178
- - A global `method:` was added to allow setting the default method, and Task's
179
- default changed to `checksum`
180
- - Two magic variables were added when using `status:` : ` CHECKSUM` and
181
- ` TIMESTAMP` which contains, respectively, the md5 checksum and greatest
182
- modification timestamp of the files listed on `sources:`
183
- - Also, the `TASK` variable is always available with the current task name
184
- - CLI variables are always treated as global variables
185
- - Added `dir:` option to `includes` to allow choosing on which directory an
186
- included Taskfile will run :
217
+ A new global option was added to configure the number of variables expansions
218
+ (which default to 2) :
187
219
188
220
` ` ` yaml
189
- includes:
190
- docs:
191
- taskfile: ./docs
192
- dir: ./docs
193
- ` ` `
221
+ version: '2'
194
222
195
- - Implemented short task syntax. All below syntaxes are equivalent :
223
+ expansions: 3
196
224
197
- ` ` ` yaml
198
- version: '3'
225
+ vars:
226
+ FOO: foo
227
+ BAR: bar
228
+ BAZ: baz
229
+ FOOBAR: '{{.FOO}}{{.BAR}}'
230
+ FOOBARBAZ: '{{.FOOBAR}}{{.BAZ}}'
199
231
200
232
tasks:
201
- print :
233
+ default :
202
234
cmds:
203
- - echo "Hello, World! "
235
+ - echo "{{.FOOBARBAZ}} "
204
236
` ` `
205
237
206
- ` ` ` yaml
207
- version: '3'
238
+ # # Version 1
208
239
209
- tasks:
210
- print:
240
+ :::caution
241
+
242
+ v1 schema support was removed in Task >= v3.0.0.
243
+
244
+ :: :
245
+
246
+ In the first version of the `Taskfile`, the `version:` key was not available,
247
+ because the tasks was in the root of the YAML document. Like this :
248
+
249
+ ` ` ` yaml
250
+ echo:
251
+ cmds:
211
252
- echo "Hello, World!"
212
253
` ` `
213
254
214
- ` ` ` yaml
215
- version: '3'
255
+ The variable priority order was also different :
216
256
217
- tasks:
218
- print: echo "Hello, World!"
219
- ` ` `
257
+ 1. Call variables
258
+ 2. Environment
259
+ 3. Task variables
260
+ 4. `Taskvars.yml` variables
220
261
221
- - There was a major refactor on how variables are handled. They're now easier to
222
- understand. The `expansions:` setting was removed as it became unnecessary.
223
- This is the order in which Task will process variables, each level can see the
224
- variables set by the previous one and override those.
225
- - Environment variables
226
- - Global + CLI variables
227
- - Call variables
228
- - Task variables
262
+ <!-- prettier-ignore-start -->
263
+ [deprecate-version-2-schema] : https://github.com/go-task/task/issues/1197
264
+ <!-- prettier-ignore-end -->
0 commit comments