-
Type:
Suggestion
-
Resolution: Won't Fix
-
Component/s: Pipelines - Manual / Scheduled Triggers
While using parameterised pipelines, we came across the situation where we write more steps to validate the variables, than for the build/release itself.
For example when releasing a new maven artefact, we enforce the user to provide the releaseVersion and the developmentVersion manually.
To ensure this, we currently run steps to regex validate each variable.
Allowing to provide a regex for variable validation, and validating it before starting the pipeline would be a great improvement
pipelines:
custom:
release:
- variables:
- name: releaseVersion
regex: "[0-9]\\.[0-9]\\.[0-9]"
- name: developmentVersion
regex: "[0-9]\\.[0-9]\\.[0-9]-SNAPSHOT"
- step:
script:
- echo "Releasing $releaseVersion"
- echo "Preparing POM for $developmentVersion"
This would help reduce failed pipelines caused by user input errors, and provide more flexibility to the pipeline developer.