YAML Specs: General syntax

This document shows how to use some of the YAML Specs code syntaxes.

要件

In order to add job requirements in the YAML code, you can use the following format:

機能タイプYAML syntax
カスタム
requirements:
     - CustomCapabilityName
実行可能ファイル
requirements:
     - system.builder.{capabilityType}.{executableLabel}
JDK
requirements:
     - system.jdk.{JDKlabel}
perforce
requirements:
     - system.p4Executable
Mercurial
requirements:
     - system.hg.executable
Xcode SDK
requirements:
     - system.builder.xcode.{SDKName}
Git
requirements:
     - system.git.executable
Docker
requirements:
     - system.docker.executable

As an example, the code below shows how to add all the requirements types available in Bamboo:

...
  # Job's requirements
  requirements:
     # Custom capabilities
     - isCustom
     - customExecutable
     # Executable capabilities
     - system.builder.mvn2.Maven 2
     - system.builder.command.Ansible
     # JDK capabilities
     - system.jdk.JDK
     - system.jdk.JDK 1.8
     # Perforce capability
     - system.p4Executable
     # Mercurial capability
     - system.hg.executable
     # Xcode SDK capabilities
     - system.builder.xcode.SDK1
     - system.builder.xcode.SDK2
     # Git capability
     - system.git.executable
     # Docker capability
     - system.docker.executable

In Bamboo 7.1.0, you can also get YAML examples by exporting an existing plan to YAML Specs.

To export a plan to YAML Specs, follow the instructions below:

  1. Go to your build plan and select Actions > Configure plan.
  2. On the plan configuration page, select Actions > View plan as YAML

Check an example of a plan below:

---
version: 2
plan:
  project-key: YAML
  key: PLAN
  name: PLAN
stages:
- Default Stage:
    manual: false
    final: false
    jobs:
    - Default Job
Default Job:
  key: JOB1
  requirements:
  - Operating System: Windows
  - system.p4Executable
  - system.docker.executable
  - system.builder.mvn2.Maven 2
  - system.builder.ant.Ant
  - system.jdk.JDK
  - isCustom: 'true'
  - system.builder.msbuild.MSBuild v4.0 (32bit)
  - system.builder.grailsBuilder.Grails 3.3
  - system.hg.executable
  - system.jdk.JDK 1.8
  - system.git.executable
  - system.builder.xcode.SDK1
triggers: []
branches:
  create: manually
  delete: never
  link-to-jira: true
notifications: []
labels: []
other:
  concurrent-build-plugin: system-default
---
version: 2
plan:
  key: YAML-PLAN
plan-permissions:
- users:
  - user
  permissions:
  - view
  - edit
  - build
  - clone
  - admin
...


詳細を確認


最終更新日 2023 年 8 月 8 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.