We're trying to use a custom pipe that builds its own workspace variable names. In the past, we've always declared the deployment and workspace variables in the variables block for the pipe and we've just been able to use them by name. Is there another way to do it that doesn't require passing the names? We're okay with the pipe getting access to all workspace/deployment variables.
Thanks!
Hi Kimberly and welcome to the community!
This is possible the following way:
An example of this can be found in the following pipe:
The variables AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION can also be configured as workspace, repository, or deployment variables and then it is not necessary to use them in the pipe's variables block.
For that to work, the variables are described in the pipe.yml file of the repo:
And then they are loaded in the pipe in the main.py file (line 529):
Please note that this will work if you later refer to the pipe in the bitbucket-pipelines.yml of another repo with - pipe atlassian/aws-cloudformation-deploy:0.20.1, so the format should be - pipe: BB_workspace/BB_repo:tag.
It will not work if you refer to the pipe by using theDocker image with - pipe: docker://docker_acct/docker_repo:tag.
Kind regards,
Theodora
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.