Add pipeline

Creates a new pipeline in the project.

Required scopes: WORKSPACE, EXECUTION_MANAGE

Resource URL

POST /workspaces/:domain/projects/:project_name/pipelines

URL Parameters

NameTypeDescription
domain
Required
StringThe workspace domain.
project_name
Required
StringThe name ID of the project.

POST Parameters

NameTypeDescription
name
Required
StringThe name of the pipeline.
ref_name
Required
StringThe wildcard, branch, tag or pull request.
trigger_mode
Required
StringThe trigger mode of the pipeline. Can be one of MANUAL, SCHEDULED or ON_EVERY_PUSH.
ref_typeStringThe branch or tag that triggers the pipeline. Can be one of BRANCH, TAG, WILDCARD, PULL_REQUESTor NONE.
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.
do_not_create_commit_statusBooleanDefines whether or not to omit sending commit statuses to Github or Gitlab upon execution.
start_dateISO 8601 UTC dateThe date when the recurrent pipeline should start. Restricted to and required if the trigger_mode is SCHEDULED and no cron is specified.
delayIntegerThe delay between executions of recurrent pipeline. Restricted to and required if the trigger_mode is SCHEDULED and no cron is specified.
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.
run_alwaysBooleanDefines whether or not to execute only if there were changes in the branch since the last execution. Restricted to trigger_mode SCHEDULED.
pausedBooleanDefines if the recurrent pipeline executions are paused or not. Restricted to trigger_modeSCHEDULED.
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_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.
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.

Example

Request

POST https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines

JSON

{
"name": "Tests",
"trigger_mode": "ON_EVERY_PUSH",
"ref_type": "BRANCH",
"ref_name": "master",
"execution_message_template": "test",
"always_from_scratch": true,
"auto_clear_cache": true,
"no_skip_to_most_recent": true,
"do_not_create_commit_status": true,
"ignore_fail_on_project_status": true
}

Sample Response

HTTP

Status: 201 Created
X-Rate-Limit-Limit: 1
X-Rate-Limit-Remaining: 999

JSON

{
"url": "https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2",
"html_url": "https://app.buddy.works/buddy/company-website/pipelines/pipeline/2",
"id": 2,
"name": "Tests",
"trigger_mode": "ON_EVERY_PUSH",
"ref_type": "BRANCH",
"ref_name": "master",
"execution_message_template": "test",
"last_execution_status": "INITIAL",
"last_execution_revision": null,
"create_date": "2016-03-29T07:12:30.675Z",
"always_from_scratch": true,
"auto_clear_cache": true,
"no_skip_to_most_recent": true,
"do_not_create_commit_status": true,
"ignore_fail_on_project_status": true,
"project": {
"url": "https://api.buddy.works/workspaces/buddy/projects/company-website",
"html_url": "https://app.buddy.works/buddy/company-website",
"name": "company-website",
"display_name": "Company Website",
"status": "ACTIVE"
},
"creator": {
"url": "https://api.buddy.works/workspaces/buddy/member/1",
"html_url": "https://app.buddy.works/buddy/profile/1",
"id": 1,
"name": "Mike Benson",
"avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png",
"title": "Creative director"
},
"actions": []
}