【问题标题】:Use docker in bamboo specs在竹规格中使用 docker
【发布时间】:2020-09-07 03:15:08
【问题描述】:

我正在尝试使用 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

【问题讨论】:

    标签: bamboo bamboo-specs


    【解决方案1】:

    规范应为:

    Lint:
      tasks:
        - script:
            - npm install
            - npm run lint
      docker:
        image: node:alpine
    

    【讨论】:

      猜你喜欢
      • 2021-09-01
      • 2021-02-04
      • 1970-01-01
      • 2022-07-27
      • 1970-01-01
      • 1970-01-01
      • 2021-11-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多