【问题标题】:Bitbucket pipeline reuse source code from previous stepBitbucket 管道重用上一步中的源代码
【发布时间】:2021-08-19 19:30:15
【问题描述】:

基本上,我不希望在后续步骤中使用管道步骤克隆代码,只有第一步会克隆一次源代码。另一个原因是如果 step clone 源代码(并且不使用之前的源代码)构建的代码将丢失。

我知道 bitbucket 管道具有工件功能,但它似乎只存储部分源代码。

流程是:

第 1 步:克隆源代码。 步骤2:并行运行两步,一是在根文件夹安装节点模块,一是在应用文件夹安装节点模块并构建js、css。 第 3 步:将部署第 2 步中构建的源代码。

这是我的 bitbucket-pipelines.yml

image: node:11.15.0

pipelines:
  default:
    - step:
        name: Build and Test
        script:
          - echo "Cloning..."
        artifacts:
          - ./**
    - parallel:
      - step:
          name: Install build
          clone:
            enabled: false
          caches:
            - build
          script:
            - npm install
      - step:
          name: Install app
          clone:
            enabled: false
          caches:
            - app
          script:
            - cd app
            - npm install
            - npm run lint
            - npm run build
    - step:
        name: Deploy
        clone:
          enabled: false
        caches:
          - build
        script:
          - node ./bin/deploy

definitions:
  caches:
    app: ./app/node_modules
    build: ./node_modules

【问题讨论】:

    标签: bitbucket pipeline bitbucket-pipelines


    【解决方案1】:

    翻了百页也没找到,只好自己一个一个去试,终于找到了所有文件的artifact的模式:

    artifacts:
      - '**'
    

    【讨论】:

      猜你喜欢
      • 2019-04-20
      • 2018-11-20
      • 1970-01-01
      • 1970-01-01
      • 2021-12-10
      • 2020-06-09
      • 1970-01-01
      • 1970-01-01
      • 2019-02-28
      相关资源
      最近更新 更多