@@ -171,12 +171,14 @@ charts:
171
171
# version to use when resetting the Chart.yaml's version field with the
172
172
# --reset flag. It defaults to "0.0.1-set.by.chartpress". This is a valid
173
173
# SemVer 2 version, which is required for a helm lint command to succeed.
174
- resetVersion : 1.2.3
175
- # Use the version in Chart.yaml for the base version,
176
- # instead of the latest tag from `git describe`
174
+ resetVersion : 1.2.3-dev
175
+
176
+ # baseVersion sets the base version for development tags,
177
+ # instead of using the latest tag from `git describe`.
177
178
# This gives you more control over development version tags
178
- # and lets you ensure prerelease tags are always sorted in the right order
179
- useChartVersion : true
179
+ # and lets you ensure prerelease tags are always sorted in the right order.
180
+ # Only useful when publishing development releases.
181
+ baseVersion : 3.2.1-0.dev
180
182
181
183
# The git repo whose gh-pages contains the charts. This can be a local
182
184
# path such as "." as well but if matching <organization>/<repo> will be
@@ -239,25 +241,24 @@ charts:
239
241
- linux/arm64
240
242
` ` `
241
243
242
- ### Controlling development versions in Chart.yaml
244
+ ### Controlling development versions
243
245
244
246
Like some "package version in version control" tools,
245
247
you don't need to manage versions at all in chartpress except by tagging commits.
246
248
247
249
However, relying only on tags results in "development versions" (versions published from commits after a release)
248
250
having somewhat confusing prerelease versions.
249
251
250
- After publishing e.g. ` 1.2.3`, the next version will be `1.2.3-0.dev.git.1 .habc`.
252
+ After publishing e.g. ` 1.2.3`, the next version will be `1.2.3-0.dev.git.10 .habc`.
251
253
According to Semantic Versioning,
252
254
this is a "pre release" (good, it should be excluded from default installation),
253
255
but it means it comes _before_ 1.2.3 (wrong! it's 1 commit _newer_ than 1.2.3).
254
256
This is because prereleases should be defined relative to the _next_ release,
255
257
not the _last_ release. But git tags only store the _last_ release!
256
258
257
- Chartpress 2.0 adds an option `chart.useChartVersion`,
258
- which changes the base version to use when setting the chart version.
259
- Instead of using the version of the last tag found via `git describe`,
260
- it uses the version found in Chart.yaml.
259
+ Chartpress 2.0 adds an option `chart.baseVersion`,
260
+ which allows setting the base version of development tags explicitly,
261
+ instead of using the version of the last tag found via `git describe`.
261
262
262
263
The main benefits of this are :
263
264
@@ -267,55 +268,46 @@ The main benefits of this are:
267
268
Instead of publishing the sequence :
268
269
269
270
- 1.2.3
270
- - 1.2.3-0.dev.git.1 .habc (later than 1.2.3, but sorts _before_ 1.2.3!)
271
+ - 1.2.3-0.dev.git.10 .habc (later than 1.2.3, but sorts _before_ 1.2.3!)
271
272
272
273
You can publish
273
274
274
275
- 1.2.3
275
- - 1.3.0-0.dev.git.1 .habc (prerelease based on the _next_ version, not _last_)
276
+ - 1.3.0-0.dev.git.10 .habc (prerelease based on the _next_ version, not _last_)
276
277
277
- where chartpress will use the version in your Chart.yaml as the base version,
278
+ where chartpress will use the version in your `baseVersion` config as the base version,
278
279
instead of the last tag on the branch.
279
280
280
- This takes some extra configuration, and steps in your release process
281
- to update the version in your Chart.yaml.
281
+ This takes some extra configuration, and steps in your release process :
282
282
283
- 1. You must set `useChartVersion : true ` in your chartpress.yaml:
283
+ 1. You must set `baseVersion : 1.2.3-0.dev ` in your chartpress.yaml to your _next_ prerelease :
284
284
285
285
` ` ` yaml
286
286
charts:
287
287
- name: mychart
288
- useChartVersion: true
288
+ baseVersion: 1.2.3-0.dev
289
289
` ` `
290
290
291
- 2. You must control the version in Chart.yaml , especially after making a release.
291
+ 2. You must update baseVersion , especially after making a release.
292
292
293
293
A release process would generally look like this :
294
294
295
295
` ` ` bash
296
296
V=1.2.3
297
- chartpress --reset --tag "$V"
298
- git commit -am "release $V"
299
297
git tag -am "release $V" "$V"
300
298
git push --atomic --follow-tags
301
299
302
300
# back to development
303
- NEXT_V=1.3.0-0.dev
304
- chartpress --reset --tag "$NEXT_V"
305
- git commit -am "Back to $NEXT_V"
301
+ NEXT_V=1.2.4-0.dev
302
+ # edit chartpress.yaml to set baseVersion: $NEXT_V
303
+ git add chartpress.yaml
304
+ git commit -m "Back to $NEXT_V"
306
305
git push --atomic
307
306
` ` `
308
307
309
308
Any prerelease fields (such as `-0.dev` above, or `-alpha.1`)
310
309
will be left as-is, with the `.git.n.hash` suffix added.
311
310
312
- If the version in Chart.yaml is not a prerelease,
313
- a prelease version will be constructed with `-0.dev.git.n.hash`.
314
-
315
- When you use this configuration,
316
- ` chartpress --reset` strips the `.git...` suffix from the chart version,
317
- ignoring the `resetVersion` config.
318
-
319
311
# # Caveats
320
312
321
313
# ## Shallow clones
0 commit comments