This is the first time we are implementing Continous testing using bitbucket pipeline. We are getting compilation error while modifyiing bitbucket-pipelines.yml file of dev repo to trigger test from a different repo (test repo), the file that we are modifying has code like this
Hi @Elumalai_ Gopal and welcome to the community!
Just a heads up, I edited the repo names from your post to protect your privacy. I'm going to use a numbered list to address issues:
1. Indentation like the following will work:
pipelines:
custom:
deploy to dev:
import: repo-1:main:deploy_to_dev
deploy to qa:
import: repo-1:main:deploy_to_qa
Spaces need to be used for indentation, not tabs.
2. Is the pipe part of the custom pipeline "deploy to qa"? If so, this is not supported at the moment. Additional steps or commands cannot be added to an imported pipeline. We have a feature request here https://jira.atlassian.com/browse/BCLOUD-22855 for sharing steps between different repos, this would allow you to import a step only and then add a second step.
The available options now are:
(a) You could add this pipe in a separate custom pipeline, different than "deploy to qa".
(b) You could look into dynamic pipelines for sharing a step: https://community.atlassian.com/forums/Forge-for-Bitbucket-Cloud/Share-a-step-across-pipelines-Dynamic-Pipelines/ba-p/2712403
(c) You could add the pipe to the definition of "deploy to qa", in the repo where you are doing the export.
(d) You could omit the import for 'deploy to qa' and just define the step and script without importing, so you can add the pipe as an additional command.
3. With regards to the pipe definition:
(a) I recommend using the latest version of the pipe, which is 5.10.1 at the moment.
(b) You need to provide authentication details to the pipe, either with the variable BITBUCKET_ACCESS_TOKEN or with the variables ATLASSIAN_ACCOUNT_EMAIL and ATLASSIAN_API_TOKEN. Please see the README.md file in the pipe's repo: https://bitbucket.org/atlassian/trigger-pipeline/src/master/ (if you scroll down, you will see the README.md)
(c) in the value of the variable CUSTOM_PIPELINE_NAME, you need to remove the part "custom: ", UNLESS this is also part of the custom pipeline's name.
If the definition of the custom pipeline in repo2 looks like this:
pipelines:
custom:
test on qa:
- variables:
- name: TestType
- step:
script:
- echo "This is test on qa pipeline"
Then you need to use CUSTOM_PIPELINE_NAME: 'test on qa' in the pipe.
Please feel free to let me know if you have any questions.
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.