Semantic versioning and settable variables

Settable variables allow you to shift values between subsequent actions or executions as well as pipelines.

Configuration

Success
In Buddy, variables can be defined on four levels: WorkspaceProjectPipelineAction.
Warning
Each subsequent tier overwrites the value from the higher one.

To pass values through the variable, check the Settable option during configuration:

Image loading...Adding a new variableAdding 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:

bash
RELEASE_NUMBER=$RELEASE_NUMBER+1$

Image loading...Default build commandsDefault 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 exampleSemantic versioning pipeline example

Last update:
Sep 23, 2024