Use a VERSION file🔗
You may want to use a version number for multiple purposes in your projects:
- displaying it somewhere in your app (e.g: backoffice footer, mobile app login/main screen, ...)
- providing it to Sentry for identifying releases and artefacts (sourcemaps) as well as triggered events
One way is to create a VERSION
file at the root of your project, containing the current version number:
1 |
|
The Manala - elao.app.docker recipes
provides a helper to bump and commit this file with a predefined message.
You can add a make version
target like this:
1 2 3 4 5 6 7 8 |
|
Then, call make version
so you'll be prompted to enter a new version number (the current one is reminded to you in the output).
Alternatively, use VERSION=1.2.3 make version
to directly provide the version number non-interactively.
A "Bump version X.X.X"
commit is automatically made with current changes (so you can even modify and automatically
include other files you need to update before a release, for instance changelogs of a mobile app).
If you're using an .editorconfig
file and a compatible IDE
(or if your teammates do), ensure this is present in the file:
1 2 |
|
So no newline is automatically appended by your editor at the end of the file.
⚠️ Be sure to include this file in your .manala.yaml
releases:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
In a Symfony app🔗
Here is a simple way to exploit the version number in your app:
1 2 3 4 5 6 7 8 9 10 11 |
|
Then, simply inject this parameter anywhere you need it.
You may also want to make it available gloablly in Twig templates:
1 2 3 4 5 6 |
|
In a Webpack Encore config🔗
1 2 3 |
|
This is especially useful to configure Sentry releases and to provide the release number to each of the triggered events.