在竹子规格中使用docker

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

我想用docker用奔步来构建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 YAML import failed: Document structure is incorrect: Lint / tasks / [0]: Task must have its type defined as the only YAML property
bamboo bamboo-specs
1个回答
0
投票

规范应该是这样的。

Lint:
  tasks:
    - script:
        - npm install
        - npm run lint
  docker:
    image: node:alpine
© www.soinside.com 2019 - 2024. All rights reserved.