Hi,I would like to combine "deployment: Dev" or "deployment: Test" together with variables for my custom pipeline.
The purpose is that I want to trigger the deployment of a specific release version either to our Dev environment or Test environment.
Therefore I need a variable "releaseVersion" and also the ability to define different environments by using the "deployment: Dev" or "deployment: Test".In fact I would like to combine:https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/#deploymentandhttps://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/#variablesBoth can be used within a custom pipeline but somehow not in combination.
Following is currently working:
pipelines:custom: deploy-dev-reset: - step:<<: *deploy-reset deployment: Dev - step: *reset-dev-elastic-search deploy-test-reset: - step:<<: *deploy-reset deployment: Test
But if I try to add variables to the custom pipline it is not working anymore:
pipelines:custom: deploy-dev-reset: - variables: - name: releaseVersionname: Deploy Dev Env - step:<<: *deploy-reset deployment: Dev - step: *reset-dev-elastic-search deploy-test-reset: - variables: - name: releaseVersionname: Deploy Test Env - step:<<: *deploy-reset deployment: Test
I could solve this issue. In general it is possible to combine "deployment" and "variables" within a custom pipeline.Example:
pipelines:custom: deploy-dev-reset: - variables: - name: releaseVersiondefault: "snapshot" - step:<<: *deploy-reset deployment: Dev - step: *reset-dev-elastic-search deploy-test-reset: - variables: - name: releaseVersiondefault: "0.1.0" - step:<<: *deploy-reset deployment: Test
The actual root cause of the issue was something else. It was just an "echo" which contained a ":"Example (which causes an error):
- echo "Re-install everything using image tag: $releaseVersion"
to use ":" within a script it needs to be escaped by using a ">"
- > echo "Re-install everything using image tag: $releaseVersion"
It looks like you're new here. Sign in or register to get started.