【发布时间】:2021-12-10 20:36:43
【问题描述】:
我在将环境变量从一个步骤传递到触发另一个 repo 中的另一个管道的步骤时遇到问题。 提取 VERSION 后,我需要触发另一个管道。
我认为将一些变量从父步骤传递到下一步只是一种常见情况,但没有关于如何执行此操作的信息。 在 atlassian/trigger-pipeline 中,我无法在触发另一个管道之前运行任何脚本步骤 管道示例:
- step:
name: upload to test
image:
name: ci:latest
script:
- bin=`ls | grep .bin`
- export VERSION=${bin%.*}
- aws s3 sync . s3://somebacketname/test/
- step:
name: testing
trigger: manual
script:
- pipe: atlassian/trigger-pipeline:4.1.5
variables:
BITBUCKET_USERNAME: $USER
BITBUCKET_APP_PASSWORD: $PASSWORD
REPOSITORY: 'test'
BRANCH_NAME: 'master'
CUSTOM_PIPELINE_NAME: 'critical-test'
WAIT: 'true'
PIPELINE_VARIABLES: >
[{
"key": "DESIRED_VERSION",
"value": "$VERSION"
},
{
"key": "DURATION",
"value": "15"
}]
【问题讨论】:
标签: environment-variables pipeline bitbucket-pipelines step