【发布时间】: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