无法从bitbucket管道yml脚本中签出git分支

问题描述 投票:0回答:1

在部署到我的QA服务器之前,我希望在暂存(或合并暂存)之前进行rebase,因此它将包含我的分支的最新更改+更改。

作为第一步,我尝试检查暂存和失败:我在bitbucket-pipelines.yml中有以下配置

merge:
- step:
    name: merge with staging
    image: node:8
    script:
    - git remote update
    - git fetch origin
    - git branch -f staging origin/staging
    - git checkout staging

错误:

+ git branch -f staging origin/staging
fatal: Not a valid object name: 'origin/staging'.

我尝试了许多本地工作的其他变种,但一切都失败了...看起来像bitbucket限制访问其他分支..

检查bitbucket管道中的分支的正确方法是什么?

git bitbucket bitbucket-pipelines
1个回答
0
投票

以下似乎是我的问题的解决方案,因为我可以避免检查暂存:

name: Build and test on QA env
image: node:8
script:
  - git fetch origin
  - git pull --rebase origin staging --verbose
  - npm ci
  - npm test
  - npm run build

另一方面,它没有回答问题,所以我暂时保持“开放”状态

© www.soinside.com 2019 - 2024. All rights reserved.