Semantic versioning and settable variables
Settable variables allow you to shift values between subsequent actions or executions as well as pipelines.
Configuration
To pass values through the variable, check the Settable option during configuration:
Image loading...Adding a new variable
Value incrementation
Let's assume you want to change the value of an action in your pipeline. In this case, you should set the variable's value directly in the build action. Use the following command to increment the value by 1 on every pipeline run:
bashRELEASE_NUMBER=$RELEASE_NUMBER+1
$
Image loading...Default build commands
Example use case
A good example of applying settable variables is using them to auto-increment the version of the application in your Git repository. Our guide on semantic versioning will tell you how to create a pipeline which:
- automatically raises the patch version (
0.0.1
) on every push to the repository - asks you to select either minor (
0.1.0
) or major (1.0.0
) version on manual execution
Image loading...Semantic versioning pipeline example
Sep 23, 2024