My project uses a mix of Repository and Deployments variables. Repository variables are being fetched correctly but there is something wrong with deployment vars for each pipeline. Below I'm attaching my bitbucket-pipelines.yaml file and a setup in Repository settings -> Deployments
Echo script were only to check if the values are being passed.
Hi @Oskar Kuklinski and welcome to the community!
I believe that the variable is empty because the syntax of the step is incorrect.
The following line can be used if you don't want to specify any additional values, like the step name and deployment environment.
- step: *env-specific-build-and-deploy
If you want to specify a different step name and deployment environment, the step should look as follows:
- step:
<<: *env-specific-build-and-deploy
name: Some name
deployment: stage
The step in the master branch pipeline needs to have a similar definition as well.
This is the documentation for reference (see section Override values)
Could you give it a try and let me know if it works for you?
Kind regards,
Theodora
Hi @Theodora Boudale and thanks for looking into it!
Unfortunately after making a change mentioned above I am getting following error when running a pipeline (nothing else in console logs):
Any idea why this could be happening? Also attaching updated bitbucket-pipelines.yaml file
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Oskar Kuklinski,
I think the error occurs because of the indentation.
See my example:
- step:
<<: *env-specific-build-and-deploy
name: Some name
deployment: stage
For the lines below -step: I am using 4 spaces for indentation. In your yml file, it looks like the indentation is 2 spaces instead, which I believe is the reason for this error.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that was indentation issue. Thanks for your help, pipeline runs successfully now!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are very welcome Oskar, I'm glad to have helped!
Please feel free to reach out if you ever need anything else!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.