【发布时间】:2019-10-02 22:30:59
【问题描述】:
我有一个用于我正在进行的项目的 bitbucket 管道 yaml 文件。当它设置为在推送时运行时,我让它运行管道正常,但由于我将其切换为在拉取请求上运行,我得到一个无效的 yml 错误。
我找到了如何配置文件的描述:https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html
在validator 中,我在第一步出现错误,上面写着Expected a string but found a mapping。
当我通过拉取请求运行它时,我收到以下错误:
Configuration error
There is an error in your bitbucket-pipelines.yml at [pipelines > pull-requests].
To be precise: This section should be a map (it is currently defined as a list).
我不确定如何修复它,因为它似乎与示例匹配。
下面是我的 yml 文件
image: node:8.10
pipelines:
pull-requests:
- step:
name: Push repo to CodeCommit
script:
- echo $CodeCommitKey > ~/.ssh/codecommit_rsa.tmp
- base64 -di ~/.ssh/codecommit_rsa.tmp > ~/.ssh/codecommit_rsa
- chmod 400 ~/.ssh/codecommit_rsa
- echo $CodeCommitConfig > ~/.ssh/config.tmp
- base64 -di ~/.ssh/config.tmp > ~/.ssh/config
- set +e
- ssh -o StrictHostKeyChecking=no $CodeCommitHost
- set -e
- git remote add codecommit ssh://$CodeCommitRepo
- git push codecommit $BITBUCKET_BRANCH
- step:
name: Test and Build
caches:
- node
script:
- npm install --no-package-lock
- npm run test
- step:
name: Deploy Serverless
script:
- npm i serverless -g
- npm run deploy
【问题讨论】:
标签: continuous-integration bitbucket bitbucket-pipelines