Hi,
I am trying to trigger a pipeline in my doc repository when a release is done in my actual code repository. For this, I am following the example given in "trigger bitbucket pipeline".
What I don't understand is how to write the pipeline which will be triggered in the other side and how use the variable send by the release pipeline ?
Thank you
You're variables will be available in your triggered pipeline as environment variables. For example, if you write your release pipeline like the following:
script: - pipe: atlassian/trigger-pipeline:4.0.5 variables: BITBUCKET_USERNAME: $BITBUCKET_USERNAME BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD REPOSITORY: 'your-awesome-repo' BRANCH_NAME: 'master' CUSTOM_PIPELINE_NAME: 'deployment-pipeline' PIPELINE_VARIABLES: > [{ "key": "AWS_DEFAULT_REGION", "value": "us-west-1" }, { "key": "AWS_ACCESS_KEY_ID", "value": "$AWS_ACCESS_KEY_ID", "secured": true }, { "key": "AWS_SECRET_ACCESS_KEY", "value": "$AWS_SECRET_ACCESS_KEY", "secured": true }] WAIT: 'true'
You can use AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_DEFAULT_REGION in your downstream pipeline like this:
pipelines:
default:
- step:
script:
- echo $AWS_ACCESS_KEY_ID
- echo $AWS_SECRET_ACCESS_KEY
- echo $AWS_DEFAULT_REGION
Thank you. I was thinking by putting the custom pipeline name as 'deployment-pipeline, i need to have a downstream pipeline like this :
pipelines:
custom:
deployment-pipeline:
- step:
script:
- echo $AWS_ACCESS_KEY_ID
- echo $AWS_SECRET_ACCESS_KEY
- echo $AWS_DEFAULT_REGION
I have a still an error when the pipeline is triggered.
Do you have an idea what it could be ?
HttpResponseSummary{httpStatusCode=400, httpStatusMessage=Bad Request, bodyAsString={"key":"variable-service.request.validation-error","message":"The request body contains invalid properties","arguments":{"value.required":"Property value is required"}}} (command VARIABLE_SERVICE_CREATE_PIPELINE_VARIABLE, error key='variable-service.request.validation-error')
Thanks you for your answer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're probably missing a variable value. Note, that there are two fields for each variable: key, which is a variable name, and value, which is an actual variable value.
{ "key": "VariableName", "value": "VariableValue" }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.