Create
- POST
- /workspaces
- /:domain
- /projects
- /:project_name
- /pipelines
Creates a new pipeline in the project.
Event schema
Here's how to define the event triggering the pipeline:
Event schema"on": "EVENT", "events": [ { "type": "PUSH", "refs": [ "refs/heads/main", "refs/heads/dev-*" ] }, { "type": "PULL_REQUEST", "events": [ "assigned", "unassigned", ], "branches": [ "main", "relesaes/*" ] }, ]
Trigger condition schema
You can define trigger conditions in the following way:
Trigger condition schema{ "trigger_conditions": [ { "trigger_condition": "VAR_IS", "trigger_variable_key": "myVar", "trigger_variable_value": "expectedValue" }, { "trigger_condition": "OR", "trigger_operands": [ { "trigger_condition": "ON_CHANGE" }, { "trigger_condition": "VAR_IS_NOT", "trigger_variable_key": "otherVar", "trigger_variable_value": "someValue" } ] } ] }
Example:
curl -X POST "https://api.buddy.works/workspaces/:domain/projects/:project_name/pipelines" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Tests",
"on": "EVENT",
"events": [
{
"type": "PUSH",
"refs": [
"refs/heads/main",
"refs/heads/dev-*"
]
},
{
"type": "PULL_REQUEST",
"events": [
"assigned",
"unassigned"
],
"branches": [
"main",
"relesaes/*"
]
}
],
"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,
"filesystem_changeset_base": "CONTENTS",
"concurrent_pipeline_runs": true,
"git_changeset_base": "LATEST_RUN_MATCHING_REF",
"permissions": {
"others": "DENIED",
"users": [
{
"id": 1,
"access_level": "READ_WRITE"
}
],
"groups": [
{
"id": 1,
"access_level": "READ_ONLY"
}
]
}
}'
EXAMPLE RESPONSE{ "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", "on": "EVENT", "events": [ { "type": "PUSH", "refs": [ "refs/heads/main", "refs/heads/dev-*" ] }, { "type": "PULL_REQUEST", "events": [ "assigned", "unassigned" ], "branches": [ "main", "releases/*" ] } ], "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, "concurrent_pipeline_runs": true, "git_changeset_base": "LATEST_RUN_MATCHING_REF", "filesystem_changeset_base": "CONTENTS", "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" }, "actions": [], "permissions": { "others": "DENIED", "users": [ { "id": 2, "access_level": "READ_ONLY" } ], "groups": [ { "id": 1, "access_level": "READ_ONLY" } ] } }
STATUS201 Created
LIMITSX-Rate-Limit-Limit: 1 X-Rate-Limit-Remaining: 999