YAML Schema

The buddy.yml file defines all pipelines in the project. Every pipeline consists of a list of actions to be executed. Below you’ll find schemas for both pipelines and actions.

Pipelines schema

The file consists of a list of pipelines:

- pipeline: "production"
trigger_mode: "MANUAL"
ref_name: "master"
variables:
- key: "username"
value: "Buddy"
settable: false
description: "var_descrption"
- pipeline: "build"
trigger_mode: "ON_EVERY_PUSH"
ref_name: "*"

Properties

NameTypeDescription
pipeline
Required
StringThe ID of the pipeline.
trigger_mode
Required
StringThe trigger mode of the pipeline. Can be one of MANUAL, SCHEDULED or ON_EVERY_PUSH.
ref_typeStringThe ref type that triggers the pipeline. Can be one of BRANCH, TAG, WILDCARD, PULL_REQUEST or NONE.
ref_nameStringThe wildcard, branch, tag or pull request. Automatically set to NONE if not provided.
always_from_scratchBooleanDefines whether or not to upload everything from scratch on every execution.
auto_clear_cacheBooleanDefines whether or not to automatically clear cache before running the pipeline .
no_skip_to_most_recentBooleanDefines whether or not to skip execution to the most recent execution.
trigger_conditionStringDefines when the build action should be run. Can be one of ALWAYS, ON_CHANGE, ON_CHANGE_AT_PATH, VAR_IS, VAR_IS_NOT, VAR_CONTAINS, VAR_NOT_CONTAINS, DATETIME or SUCCESS_PIPELINE. Can't be used in deployment actions.
trigger_condition_pathsString[]Required when trigger_condition is set to ON_CHANGE_AT_PATH.
trigger_variable_keyStringRequired when trigger_condition is set to VAR_IS, VAR_IS_NOT or VAR_CONTAINS or VAR_NOT_CONTAINS. Defines the name of the desired variable.
trigger_variable_valueStringRequired when trigger_condition is set to VAR_IS, VAR_IS_NOT or VAR_CONTAINS or VAR_NOT_CONTAINS. Defines the value of the desired variable which will be compared with its current value.
do_not_create_commit_statusBooleanDefines whether or not to omit sending commit statuses to Github or Gitlab upon execution.
start_dateiso 8601 utc dateRequired if the pipeline is set to trigger_mode SCHEDULED and no cron is specified. Defines when the pipeline execution should start. Format: 2016-11-18T12:38:16.000Z
delayIntegerRequired if the pipeline is set to trigger_mode SCHEDULED and no cron is specified. Defines the intervals in which the pipeline should be executed (in minutes).
cronStringRequired if the pipeline is set to trigger_mode SCHEDULED and neither start_date nor delay is specified. The standard CRON expression defining the execution schedule.
actions_listString[]The list of actions executed in the pipeline.
variablesVariable[]The list of variables you can use in the pipeline.
ignore_fail_on_project_statusBooleanIf set to true the status of a given pipeline will not impact the project status on the dashboard.
execution_message_templateStringThe title of every execution in this pipeline. By default it is set to $BUDDY_EXECUTION_REVISION_SUBJECT.
trigger_hoursInteger[]Available when trigger_condition is set to DATETIME. Defines the time – by default running from 1 to 24.
trigger_daysInteger[]Available when trigger_condition is set to DATETIME. Defines the days running from 1 to 7 where 1 is for Monday.
zone_idStringAvailable when trigger_condition is set to DATETIME. Defines the timezone (by default it is UTC) and takes values from here.
trigger_project_nameStringRequired when trigger_condition is set to SUCCESS_PIPELINE. Defines the name of the project in which the trigger_pipeline_name is.
trigger_pipeline_nameStringRequired when trigger_condition is set to SUCCESS_PIPELINE. Defines the name of the pipeline.

Actions schema

Every pipeline contains a list of actions. The actions are executed in the order provided in the .yml file:

- pipeline: "production"
trigger_mode: "MANUAL"
ref_name: "master"
ref_type: "BRANCH"
execution_message_template: "test"
ignore_fail_on_project_status: "true"
actions:
- action: "Execute: npm test"
type: "BUILD"
docker_image_name: "library/node"
docker_image_tag: "6"
execute_commands:
- "npm install"
- "npm test"
setup_commands:
- "npm install -g gulp grunt-cli"
variables:
- key: "username"
value: "Buddy"
settable: true
description: "var_description"
- action: "Upload files to buddy.server"
type: "FTP"
input_type: "BUILD_ARTIFACTS"
local_path: "/"
login: "buddy"
password: "password"
host: "buddy.server"
port: "21"

Properties

NameTypeDescription
action
Required
StringThe ID of the action.
type
Required
StringThe type of the action.
trigger_timeStringSpecifies when the action should be executed. Can be one of ON_EVERY_EXECUTION, ON_FAILURE or ON_BACK_TO_SUCCESS. The default value is ON_EVERY_EXECUTION.
variablesVariable[]The list of variables you can use the action.
trigger_conditionStringDefines when the build action should be run. Can be one of ALWAYS, ON_CHANGE, ON_CHANGE_AT_PATH, VAR_IS, VAR_IS_NOT, VAR_CONTAINS, VAR_NOT_CONTAINS, DATETIME or SUCCESS_PIPELINE. Can't be used in deployment actions.
trigger_condition_pathsString[]Required when trigger_condition is set to ON_CHANGE_AT_PATH.
trigger_variable_keyStringRequired when trigger_condition is set to VAR_IS, VAR_IS_NOT or VAR_CONTAINS or VAR_NOT_CONTAINS. Defines the name of the desired variable.
trigger_variable_valueStringRequired when trigger_condition is set to VAR_IS, VAR_IS_NOT or VAR_CONTAINS or VAR_NOT_CONTAINS. Defines the value of the desired variable which will be compared with its current value.
timeoutIntegerThe timeout in seconds.
disabledBooleanWhen set to true the action is disabled. By default it is set to false.
run_next_parallelBooleanWhen set to true, the subsequent action defined in the pipeline will run in parallel to the current action.
run_only_on_first_failureBooleanDefines whether the action should be executed on each failure. Restricted to and required if the trigger_time is ON_FAILURE.
trigger_hoursInteger[]Available when trigger_condition is set to DATETIME. Defines the time – by default running from 1 to 24.
trigger_daysInteger[]Available when trigger_condition is set to DATETIME. Defines the days running from 1 to 7 where 1 is for Monday.
zone_idStringAvailable when trigger_condition is set to DATETIME. Defines the timezone (by default it is UTC) and takes values from here.
trigger_project_nameStringRequired when trigger_condition is set to SUCCESS_PIPELINE. Defines the name of the project in which the trigger_pipeline_name is.
trigger_pipeline_nameStringRequired when trigger_condition is set to SUCCESS_PIPELINE. Defines the name of the pipeline.
ignore_errorsBooleanIf set to true the execution will proceed, mark action as a warning and jump to the next action. Doesn't apply to deployment actions.

On top of these properties every action has a set properties unique to its type. You can read how to define each type of action in separate articles.

Variables schema

You can define variables in the following way:

variables:
- key: "login"
value: "secure!GKOIn5ZIS+GOqpWRm9eQpg=="
encrypted: true
settable: true
description: "login"
- key: "id_myKey"
value: "secure!0HkLQ1YOqFlB9+Y4udxjbw=="
encrypted: true
description: "My custom SSH key"
ssh_key: true

Properties

NameTypeDescription
key
Required
StringThe name of the variable.
value
Required
StringThe value of the variable.
descriptionStringThe optional description of the variable.
encryptedBooleanWhen set to true the variable value will be encrypted and hidden.
settableBooleanWhen set to true the variable value can be shifted between subsequent actions or executions as well as pipelines.
ssh_keyBooleanWhen set to true the given variable will be marked as an SSH key.

Using encrypted variables in YAML with Buddy Encryption Tool

To define a variable with the encrypted value:

  1. Go to the Pipelines tab and click YAML helper in the right menu. Select Generate an encrypted value: Generating a new encrypted value

  2. Provide the input value and click Encrypt. It will produce a hash that you can copy and safely use in your YAML: Setting a new encrypted value

The salt which is used to encrypt the values is unique for each workspace. If you change it, you will need to change all encrypted values in your YAMLs.

The value should be changed only when you move your pipelines with the export/import option – either to another workspace, or from Cloud to the on-premises version.

Multiline YAML

To apply multiline in YAML, use the | (pipe) character:

pipeline: |
first line
second line

Please mind that some fields are collections and should retain the collection structure. This applies to SSH and build actions:

- action: "Execute: ls"
type: "BUILD"
execute_commands:
- npm install
- npm test
- npm build

If you want to apply multine in such actions, you need to define it as an element of the execute_commands collection:

- action: "Execute: ls"
type: "BUILD"
execute_commands:
- |
npm install &&
npm test
- npm build