在 bamboo 规范中使用 docker
Use docker in bamboo specs
我正在尝试使用 docker 通过 Bamboo 构建 NPM 项目。我该怎么做?
---
version: 2
plan:
project-key: WEBSITE
name: Build
key: BD
stages:
- Lint and Test:
- Lint
- Build Artifact:
- Build Artifact
- Publish Image:
- Publish Image
Lint:
tasks:
- script:
- npm install
- npm lint
dockerImage: node:alpine
Build Artifact:
tasks:
- script:
- ${bamboo_capability_system_builder_npm} install
- ${bamboo_capability_system_builder_npm} run build
- script:
- cp -r content build/
- cp release/* build/
requirements:
- node
artifacts:
- name: release
pattern: build/**
Publish Image:
tasks:
- artifact-download:
source-plan: WEBSITE-BD
artifacts:
- name: release
Bamboo 抛出错误:
Bamboo YAML import failed: Document structure is incorrect: Lint / tasks / [0]: Task must have its type defined as the only YAML property
规范应为:
Lint:
tasks:
- script:
- npm install
- npm run lint
docker:
image: node:alpine
我正在尝试使用 docker 通过 Bamboo 构建 NPM 项目。我该怎么做?
---
version: 2
plan:
project-key: WEBSITE
name: Build
key: BD
stages:
- Lint and Test:
- Lint
- Build Artifact:
- Build Artifact
- Publish Image:
- Publish Image
Lint:
tasks:
- script:
- npm install
- npm lint
dockerImage: node:alpine
Build Artifact:
tasks:
- script:
- ${bamboo_capability_system_builder_npm} install
- ${bamboo_capability_system_builder_npm} run build
- script:
- cp -r content build/
- cp release/* build/
requirements:
- node
artifacts:
- name: release
pattern: build/**
Publish Image:
tasks:
- artifact-download:
source-plan: WEBSITE-BD
artifacts:
- name: release
Bamboo 抛出错误:
Bamboo YAML import failed: Document structure is incorrect: Lint / tasks / [0]: Task must have its type defined as the only YAML property
规范应为:
Lint:
tasks:
- script:
- npm install
- npm run lint
docker:
image: node:alpine