Build action

POST Parameters

NameTypeDescription
docker_image_name
Required
StringThe name of the Docker image.
docker_image_tag
Required
StringThe tag of the Docker image.
execute_commands
Required
String[]The commands that will be executed.
name
Required
StringThe name of the action.
trigger_time
Required
StringSpecifies when the action should be executed. Can be one of ON_EVERY_EXECUTION, ON_FAILURE or ON_BACK_TO_SUCCESS.
type
Required
StringThe type of the action. Should be set to BUILD.
run_as_userStringAll build commands are run as the default user defined in the selected Docker image. Can be set to another username (on the condition that this user exists in the selected image).
mount_filesystem_pathStringThe directory in which the pipeline filesystem will be mounted.
cached_dirsString[]The dependencies & directories to be cached and available to every
working_directoryStringThe directory in which the pipeline filesystem will be mounted.
setup_commandsString[]The command that will be executed only on the first run.
servicesService[]The containers with the services that will be attached to this environment. Available types: MYSQL, MONGO_DB, MARIADB, POSTGRE_SQL, REDIS, MEMCACHED, ELASTICSEARCH.
main_service_nameStringThe hostname of the container in which the action is run. The container will be available under this name in the docker network for services defined in the services field.
shellStringThe name of the shell that will be used to execute commands. Can be one of SH or BASH (default).
after_action_idIntegerThe numerical ID of the action, after which this action should be added.
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 or VAR_CONTAINS or VAR_NOT_CONTAINS.
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 it's current value.
variablesVariable []The list of variables defined for this action.

Example

Request

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

JSON

{
"name": "Build application",
"type": "BUILD",
"trigger_time": "ON_EVERY_EXECUTION",
"docker_image_name": "library/ubuntu",
"docker_image_tag": "latest",
"mount_filesystem_path": "/buddy/git-repo",
"execute_commands": [
"ls -al > ls.log"
],
"setup_commands": [
"apt-get update -y",
"apt-get install -y wget"
],
"cached_dirs": [
"/build/test",
"/bin/Debug"
],
"variables": [
{
"key": "ftp_login",
"value": "userLogin123",
"description": "The name of user to FTP.",
"encrypted": false,
"settable": false
},
{
"key": "ftp_password",
"value": "secure!14ivLMxPgv7TX6c9+ITX/g==",
"description": "The password for ftp.",
"encrypted": true
}
]
"trigger_condition": "VAR_IS_NOT",
"trigger_variable_key": "BUDDY_EXECUTION_BRANCH",
"trigger_variable_value": "master",
"working_directory": "/buddy/my-repo-dir",
"shell": "SH",
"main_service_name": "my-app.svc",
"services": [
{
"type": "MYSQL",
"version": "5.7"
},
{
"type": "MONGO_DB",
"version": "3.2.4"
}
]
}

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/actions/2",
"html_url": "https://app.buddy.works/buddy/company-website/pipelines/action/2/edit",
"id": 2,
"name": "Build application",
"type": "BUILD",
"trigger_time": "ON_EVERY_EXECUTION",
"last_execution_status": "INITIAL",
"run_only_on_first_failure": false,
"docker_image_name": "library/ubuntu",
"docker_image_tag": "latest",
"mount_filesystem_path": "/buddy/git-repo",
"execute_commands": [
"ls -al > ls.log"
],
"setup_commands": [
"apt-get update -y",
"apt-get install -y wget"
],
"cached_dirs": [
"/build/test",
"/bin/Debug"
],
"variables": [
{
"key": "ftp_login",
"value": "userLogin123",
"description": "The name of user to FTP.",
"encrypted": false,
"settable": false
},
{
"key": "ftp_password",
"value": "secure!14ivLMxPgv7TX6c9+ITX/g==",
"description": "The password for ftp.",
"encrypted": true
}
]
"trigger_condition": "ON_CHANGE_AT_PATH",
"trigger_condition_paths": [
"/src",
"/tests"
],
"working_directory": "/buddy/my-repo-dir",
"shell": "SH",
"main_service_name": "my-app.svc",
"services": [
{
"type": "MYSQL",
"version": "5.7",
"connection": {
"address": "mysql:3306",
"user": "root",
"password": "qwerty"
}
},
{
"type": "MONGO_DB",
"version": "3.2.4",
"connection": {
"address": "mongo:27017"
}
}
],
"pipeline": {
"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": "Live mirror",
"trigger_mode": "MANUAL",
"ref_name": "master",
"last_execution_status": "SUCCESSFUL",
"last_execution_revision": "506a3963507943d6908154f4bc9646e829128a08"
}
}

Example for build action services

Parameters of the service

NameTypeDescription
type
Required
StringThe type of the attached service. Can be one of MYSQL, MARIADB, REDIS, MONGO_DB, POSTGRE_SQL, CASSANDRA, MEMCACHED, ELASTICSEARCH, SELENIUM_CHROME, SELENIUM_FIREFOX, GANACHE, NODEOS, RABBITMQ, CUSTOM.
run_as_userStringAll build commands are run as the default user defined in the selected Docker image. Can be set to another username (on the condition that this user exists in the selected image).
mount_filesystem_pathStringThe directory in which the pipeline filesystem will be mounted.
connection
Required
ConnectionThe service’s connection details.
persistentBooleanIf set to true, the database content will be cached between executions. Available when type is set to MYSQL, MARIADB, REDIS, MONGO_DB, POSTGRE_SQL, CASSANDRA, GANACHE or NODEOS.
versionStringThe version of the predefined service’s base image. Required for every type except for CUSTOM.
dump_pathStringThe path to the SQL dump file that will be used to populate service’s database. Available when type is set to MARIADB, POSTGRE_SQL or MYSQL.
docker_image_nameStringThe name of the Docker image. Available when type is set to CUSTOM.
docker_image_tagStringThe tag of the Docker image. Available when type is set to CUSTOM.
registryStringThe url to the Docker registry or GCR. Available when type is set to CUSTOM.
loginStringWhen type is set to custom, this is the username required to connect to the Dockerhub, private registry or GCR.
passwordStringWhen type is set to custom, this is the password required to connect to the Dockerhub, private registry or GCR.
working_directoryStringThe directory in which the commands are executed. Available when type is set to CUSTOM.
inline_commandsStringThe command that will be executed upon running the container with the service. Available when typeis set to CUSTOM.
mount_filesystem_pathStringThe directory in which the pipeline filesystem will be mounted. Available when type is set to CUSTOM.
cached_dirsString[]The additional container’s directories that will be cached between executions. Available when type is set to CUSTOM.
use_image_from_actionBooleanIf set to true the Docker image will be taken from action defined by docker_build_action_id. Available when type is set to CUSTOM.
docker_build_action_idIntegerThe ID of the action which built the desired Docker image. If set to 0, the image will be taken from previous pipeline action. Available when type is set to CUSTOM.
integration_idIntegrationThe integration. Required for using the image from the Amazon ECR. Available when type is set to CUSTOM.
regionStringThe name of the Amazon S3 region. Available when type is set to CUSTOM. Required for using the image from the Amazon ECR. The full list of regions is available here.
wait_for_portIntegerBuild commands in the main container will be executed only if the entered service port is responding. Available when type is set to CUSTOM.

Parameters of the connection item

NameTypeDescription
host
Required
StringThe hostname that will be available within the docker network upon the execution.
dbStringThe initial database name. Available when type is set to MARIADB, POSTGRE_SQL or MYSQL.
portIntegerThe service’s connection port.
userStringDefines the username used in the desired service. Available and required when type is set to MYSQL, MARIADB, POSTGRE_SQL or RABBITMQ.
passwordStringDefines the password used in the desired service. Available and required when type is set to MYSQL, MARIADB, POSTGRE_SQL or RABBITMQ.
run_as_userStringAll build commands are run as the default user defined in the selected Docker image. Can be set to another username (on the condition that this user exists in the selected image).

Request

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

JSON

{
"name": "Build application",
"type": "BUILD",
"trigger_time": "ON_EVERY_EXECUTION",
"docker_image_name": "library/ubuntu",
"docker_image_tag": "latest",
"mount_filesystem_path": "/buddy/git-repo",
"mount_filesystem_path": "/buddy/git-repo",
"execute_commands": [
"ls -al > ls.log"
],
"variables": [
{
"key": "ftp_login",
"value": "userLogin123",
"description": "The name of user to FTP.",
"encrypted": false,
"settable": false
},
{
"key": "ftp_password",
"value": "secure!14ivLMxPgv7TX6c9+ITX/g==",
"description": "The password for ftp.",
"encrypted": true
}
]
"services": [
{
"type": "CUSTOM",
"connection": {
"host": "custom.service"
},
"use_image_from_action": true,
"docker_build_action_id": 0,
"wait_for_port": 1234,
"working_directory": "/buddy/git-repo",
"mount_filesystem_path": "/buddy/git-repo",
"cached_dirs": [
"/var/data/"
]
},
{
"type": "MYSQL",
"version": "5.7",
"persistent": true,
"connection": {
"host": "mysql",
"user": "root",
"password": "root"
}
},
{
"type": "MARIADB",
"version": "10.1.16",
"persistent": true,
"connection": {
"host": "mariadb",
"user": "root",
"password": "root"
}
},
{
"type": "REDIS",
"version": "3.2.1",
"persistent": true,
"connection": {
"host": "redis"
}
},
{
"type": "MONGO_DB",
"version": "3.2.4",
"persistent": true,
"connection": {
"host": "mongo"
}
},
{
"type": "POSTGRE_SQL",
"version": "9.5.3",
"persistent": true,
"connection": {
"host": "postgres",
"user": "root",
"password": "root"
}
},
{
"type": "CASSANDRA",
"version": "3.11",
"persistent": true,
"connection": {
"host": "cassandra"
}
},
{
"type": "MEMCACHED",
"version": "1.4.29",
"connection": {
"host": "memcached"
}
},
{
"type": "ELASTICSEARCH",
"version": "2.3.4",
"connection": {
"host": "elasticsearch"
}
},
{
"type": "SELENIUM_FIREFOX",
"version": "3.0.1",
"connection": {
"host": "selenium-ff"
}
},
{
"type": "SELENIUM_CHROME",
"version": "3.0.1",
"connection": {
"host": "selenium-ch"
}
},
{
"type": "NODEOS",
"version": "latest",
"persistent": true,
"plugins": [
"eosio::history_api_plugin",
"eosio::history_plugin",
"eosio::chain_api_plugin",
"eosio::chain_plugin",
"eosio::faucet_testnet_plugin",
"eosio::http_plugin",
"eosio::net_api_plugin",
"eosio::producer_plugin",
"eosio::txn_test_gen_plugin",
"eosio::wallet_plugin",
"eosio::wallet_api_plugin"
]
},
{
"type": "GANACHE",
"version": "latest",
"persistent": true,
"connection": {
"host": "ganache"
},
"gas_price": 20000000000,
"gas_limit": 90000,
"accounts": [
"0xfd7ac8b32e8a2391cad323efd7b162d77dd9ca67806d09877552c38b618713a5:1000000000000000000"
]
},
{
"type": "RABBIT_MQ",
"version": "3.7.8",
"persistent": true,
"connection": {
"host": "rabbitmq",
"user": "guest",
"password": "guest"
}
}
]
}

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/actions/2",
"html_url": "https://app.buddy.works/buddy/company-website/pipelines/action/2/edit",
"id": 2,
"name": "Build application",
"type": "BUILD",
"trigger_time": "ON_EVERY_EXECUTION",
"last_execution_status": "INITIAL",
"run_only_on_first_failure": false,
"docker_image_name": "library/ubuntu",
"docker_image_tag": "latest",
"mount_filesystem_path": "/buddy/git-repo",
"execute_commands": [
"ls -al > ls.log"
],
"variables": [
{
"key": "ftp_login",
"value": "userLogin123",
"description": "The name of user to FTP.",
"encrypted": false,
"settable": false
},
{
"key": "ftp_password",
"value": "secure!14ivLMxPgv7TX6c9+ITX/g==",
"description": "The password for ftp.",
"encrypted": true
}
]
"services": [
{
"type": "MYSQL",
"version": "5.7",
"persistent": true,
"connection": {
"host": "mysql",
"port": 3306,
"user": "root",
"password": "root"
},
"plugins": []
},
{
"type": "MARIADB",
"version": "10.1.16",
"persistent": true,
"connection": {
"host": "mariadb",
"port": 3306,
"user": "root",
"password": "root"
},
"plugins": []
},
{
"type": "REDIS",
"version": "3.2.1",
"persistent": true,
"connection": {
"host": "redis",
"port": 6379
},
"plugins": []
},
{
"type": "MONGO_DB",
"version": "3.2.4",
"persistent": true,
"connection": {
"host": "mongo",
"port": 27017
},
"plugins": []
},
{
"type": "POSTGRE_SQL",
"version": "9.5.3",
"persistent": true,
"connection": {
"host": "postgres",
"port": 5432,
"user": "root",
"password": "root"
},
"plugins": []
},
{
"type": "CASSANDRA",
"version": "3.11",
"persistent": true,
"connection": {
"host": "cassandra",
"port": 9042
},
"plugins": []
},
{
"type": "MEMCACHED",
"version": "1.4.29",
"persistent": false,
"connection": {
"host": "memcached",
"port": 11211
},
"plugins": []
},
{
"type": "ELASTICSEARCH",
"version": "2.3.4",
"persistent": false,
"connection": {
"host": "elasticsearch",
"port": 9200
},
"plugins": []
},
{
"type": "SELENIUM_FIREFOX",
"version": "3.0.1",
"persistent": false,
"connection": {
"host": "selenium-ff",
"port": 4444
},
"plugins": []
},
{
"type": "SELENIUM_CHROME",
"version": "3.0.1",
"persistent": false,
"connection": {
"host": "selenium-ch",
"port": 4444
},
"plugins": []
},
{
"type": "NODEOS",
"version": "latest",
"persistent": true,
"connection": {
"host": "nodeos",
"port": 8888
},
"plugins": [
"eosio::history_api_plugin",
"eosio::history_plugin",
"eosio::chain_api_plugin",
"eosio::chain_plugin",
"eosio::faucet_testnet_plugin",
"eosio::http_plugin",
"eosio::net_api_plugin",
"eosio::producer_plugin",
"eosio::txn_test_gen_plugin",
"eosio::wallet_plugin",
"eosio::wallet_api_plugin"
]
},
{
"type": "GANACHE",
"version": "latest",
"persistent": true,
"connection": {
"host": "ganache",
"port": 8545
},
"gas_price": 20000000000,
"gas_limit": 90000,
"accounts": [
"0xfd7ac8b32e8a2391cad323efd7b162d77dd9ca67806d09877552c38b618713a5:1000000000000000000"
]
},
{
"type": "RABBIT_MQ",
"version": "3.7.8",
"persistent": true,
"connection": {
"host": "rabbitmq",
"port": 5672,
"user": "guest",
"password": "guest"
}
}
],
"pipeline": {
"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": "Live mirror",
"trigger_mode": "MANUAL",
"ref_name": "master",
"last_execution_status": "SUCCESSFUL",
"last_execution_revision": "506a3963507943d6908154f4bc9646e829128a08"
}
}

Build action using private image from Dockerhub

POST Parameters

NameTypeDescription
docker_image_name
Required
StringThe name of the Docker image.
docker_image_tag
Required
StringThe tag of the Docker image.
execute_commands
Required
String[]The commands that will be executed.
name
Required
StringThe name of the action.
trigger_time
Required
StringSpecifies when the action should be executed. Can be one of ON_EVERY_EXECUTION, ON_FAILURE or ON_BACK_TO_SUCCESS.
type
Required
StringThe type of the action. Should be set to BUILD.
login
Required
StringThe username required to connect to the Dockerhub.
password
Required
StringThe password required to connect to the Dockerhub.
run_as_userStringAll build commands are run as the default user defined in the selected Docker image. Can be set to another username (on the condition that this user exists in the selected image).
mount_filesystem_pathStringThe directory in which the pipeline filesystem will be mounted.
cached_dirsString[]The dependencies & directories to be cached and available to every execution in this pipeline.
setup_commandsString[]The command that will be executed only on the first run.
servicesService[]The containers with the services that will be attached to this environment. Available types: MYSQL, MONGO_DB, MARIADB, POSTGRE_SQL, REDIS, MEMCACHED, ELASTICSEARCH.
after_action_idIntegerThe numerical ID of the action, after which this action should be added.
variablesVariable []The list of variables defined for this action.

Example

Request

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

JSON

{
"name": "Build application",
"type": "BUILD",
"trigger_time": "ON_EVERY_EXECUTION",
"docker_image_name": "buddyworks/private_image",
"docker_image_tag": "latest",
"mount_filesystem_path": "/buddy/git-repo",
"execute_commands": [
"ls -al > ls.log"
],
"variables": [
{
"key": "ftp_login",
"value": "userLogin123",
"description": "The name of user to FTP.",
"encrypted": false,
"settable": false
},
{
"key": "ftp_password",
"value": "secure!14ivLMxPgv7TX6c9+ITX/g==",
"description": "The password for ftp.",
"encrypted": true
}
]
"login": "buddyworks",
"password": "top_secret_password"
}

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/actions/2",
"html_url": "https://app.buddy.works/buddy/company-website/pipelines/action/2/edit",
"id": 2,
"name": "Build application",
"type": "BUILD",
"trigger_time": "ON_EVERY_EXECUTION",
"last_execution_status": "INITIAL",
"run_only_on_first_failure": false,
"docker_image_name": "buddyworks/private_image",
"docker_image_tag": "latest",
"mount_filesystem_path": "/buddy/git-repo",
"execute_commands": [
"ls -al > ls.log"
],
"variables": [
{
"key": "ftp_login",
"value": "userLogin123",
"description": "The name of user to FTP.",
"encrypted": false,
"settable": false
},
{
"key": "ftp_password",
"value": "secure!14ivLMxPgv7TX6c9+ITX/g==",
"description": "The password for ftp.",
"encrypted": true
}
]
"login": "buddyworks",
"pipeline": {
"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": "Live mirror",
"trigger_mode": "MANUAL",
"ref_name": "master",
"last_execution_status": "SUCCESSFUL",
"last_execution_revision": "506a3963507943d6908154f4bc9646e829128a08"
}
}

Build action using image from private registry

POST Parameters

NameTypeDescription
docker_image_name
Required
StringThe name of the Docker image.
docker_image_tag
Required
StringThe tag of the Docker image.
execute_commands
Required
String[]The commands that will be executed.
name
Required
StringThe name of the action.
trigger_time
Required
StringSpecifies when the action should be executed. Can be one of ON_EVERY_EXECUTION, ON_FAILURE or ON_BACK_TO_SUCCESS.
type
Required
StringThe type of the action. Should be set to BUILD.
login
Required
StringThe username required to connect to the Docker registry.
password
Required
StringThe password required to connect to the Docker registry.
registry
Required
StringThe url to the Docker registry.
run_as_userStringAll build commands are run as the default user defined in the selected Docker image. Can be set to another username (on the condition that this user exists in the selected image).
mount_filesystem_pathStringThe directory in which the pipeline filesystem will be mounted.
cached_dirsString[]The dependencies & directories to be cached and available to every execution in this pipeline.
setup_commandsString[]The command that will be executed only on the first run.
servicesService[]The containers with the services that will be attached to this environment. Available types: MYSQL, MONGO_DB, MARIADB, POSTGRE_SQL, REDIS, MEMCACHED, ELASTICSEARCH.
after_action_idIntegerThe numerical ID of the action, after which this action should be added.
variablesVariable []The list of variables defined for this action.

Example

Request

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

JSON

{
"name": "Build application",
"type": "BUILD",
"trigger_time": "ON_EVERY_EXECUTION",
"docker_image_name": "buddyworks/private_image",
"docker_image_tag": "latest",
"mount_filesystem_path": "/buddy/git-repo",
"execute_commands": [
"ls -al > ls.log"
],
"variables": [
{
"key": "ftp_login",
"value": "userLogin123",
"description": "The name of user to FTP.",
"encrypted": false,
"settable": false
},
{
"key": "ftp_password",
"value": "secure!14ivLMxPgv7TX6c9+ITX/g==",
"description": "The password for ftp.",
"encrypted": true
}
]
"login": "buddyworks",
"password": "top_secret_password",
"registry": "my.registry.com"
}

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/actions/2",
"html_url": "https://app.buddy.works/buddy/company-website/pipelines/action/2/edit",
"id": 2,
"name": "Build application",
"type": "BUILD",
"trigger_time": "ON_EVERY_EXECUTION",
"last_execution_status": "INITIAL",
"run_only_on_first_failure": false,
"docker_image_name": "buddyworks/private_image",
"docker_image_tag": "latest",
"mount_filesystem_path": "/buddy/git-repo",
"execute_commands": [
"ls -al > ls.log"
],
"variables": [
{
"key": "ftp_login",
"value": "userLogin123",
"description": "The name of user to FTP.",
"encrypted": false,
"settable": false
},
{
"key": "ftp_password",
"value": "secure!14ivLMxPgv7TX6c9+ITX/g==",
"description": "The password for ftp.",
"encrypted": true
}
]
"login": "buddyworks",
"registry": "my.registry.com",
"pipeline": {
"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": "Live mirror",
"trigger_mode": "MANUAL",
"ref_name": "master",
"last_execution_status": "SUCCESSFUL",
"last_execution_revision": "506a3963507943d6908154f4bc9646e829128a08"
}
}

Build action using image from Google Container Registry

POST Parameters

NameTypeDescription
docker_image_name
Required
StringThe name of the Docker image.
docker_image_tag
Required
StringThe tag of the Docker image.
execute_commands
Required
String[]The commands that will be executed.
name
Required
StringThe name of the action.
trigger_time
Required
StringSpecifies when the action should be executed. Can be one of ON_EVERY_EXECUTION, ON_FAILURE or ON_BACK_TO_SUCCESS.
type
Required
StringThe type of the action. Should be set to BUILD.
login
Required
StringThe username required to connect to the Google Container Registry.
password
Required
StringThe password required to connect to the Google Container Registry.
registry
Required
StringThe url to the Google Docker registry.
run_as_userStringAll build commands are run as the default user defined in the selected Docker image. Can be set to another username (on the condition that this user exists in the selected image).
mount_filesystem_pathStringThe directory in which the pipeline filesystem will be mounted.
cached_dirsString[]The dependencies & directories to be cached and available to every execution in this pipeline.
setup_commandsString[]The command that will be executed only on the first run.
servicesService[]The containers with the services that will be attached to this environment. Available types: MYSQL, MONGO_DB, MARIADB, POSTGRE_SQL, REDIS, MEMCACHED, ELASTICSEARCH.
after_action_idIntegerThe numerical ID of the action, after which this action should be added.
variablesVariable []The list of variables defined for this action.

Example

Request

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

JSON

{
"name": "Build application",
"type": "BUILD",
"trigger_time": "ON_EVERY_EXECUTION",
"docker_image_name": "tokyo-house-147623/private_image",
"docker_image_tag": "latest",
"mount_filesystem_path": "/buddy/git-repo",
"execute_commands": [
"ls -al > ls.log"
],
"variables": [
{
"key": "ftp_login",
"value": "userLogin123",
"description": "The name of user to FTP.",
"encrypted": false,
"settable": false
},
{
"key": "ftp_password",
"value": "secure!14ivLMxPgv7TX6c9+ITX/g==",
"description": "The password for ftp.",
"encrypted": true
}
]
"login": "_json_key",
"password": "${google_json_key}",
"registry": "my.gcr.com"
}

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/actions/2",
"html_url": "https://app.buddy.works/buddy/company-website/pipelines/action/2/edit",
"id": 2,
"name": "Build application",
"type": "BUILD",
"trigger_time": "ON_EVERY_EXECUTION",
"last_execution_status": "INITIAL",
"run_only_on_first_failure": false,
"docker_image_name": "tokyo-house-147623/private_image",
"docker_image_tag": "latest",
"mount_filesystem_path": "/buddy/git-repo",
"execute_commands": [
"ls -al > ls.log"
],
"variables": [
{
"key": "ftp_login",
"value": "userLogin123",
"description": "The name of user to FTP.",
"encrypted": false,
"settable": false
},
{
"key": "ftp_password",
"value": "secure!14ivLMxPgv7TX6c9+ITX/g==",
"description": "The password for ftp.",
"encrypted": true
}
]
"login": "_json_key",
"registry": "my.gcr.com"
"pipeline": {
"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": "Live mirror",
"trigger_mode": "MANUAL",
"ref_name": "master",
"last_execution_status": "SUCCESSFUL",
"last_execution_revision": "506a3963507943d6908154f4bc9646e829128a08"
}
}

Build action using image from Amazon ECR

POST Parameters

NameTypeDescription
docker_image_name
Required
StringThe name of the Docker image.
docker_image_tag
Required
StringThe tag of the Docker image.
execute_commands
Required
String[]The commands that will be executed.
name
Required
StringThe name of the action.
trigger_time
Required
StringSpecifies when the action should be executed. Can be one of ON_EVERY_EXECUTION, ON_FAILURE or ON_BACK_TO_SUCCESS.
type
Required
StringThe type of the action. Should be set to BUILD.
integration
Required
IntegrationThe integration.
region
Required
StringThe name of the Amazon S3 region. Required for using the image from the Amazon ECR. The full list of regions is available here.
cached_dirsString[]The dependencies & directories to be cached and available to every execution in this pipeline.
run_as_userStringAll build commands are run as the default user defined in the selected Docker image. Can be set to another username (on the condition that this user exists in the selected image).
mount_filesystem_pathStringThe directory in which the pipeline filesystem will be mounted.
setup_commandsString[]The command that will be executed only on the first run.
servicesService[]The containers with the services that will be attached to this environment. Available types: MYSQL, MONGO_DB, MARIADB, POSTGRE_SQL, REDIS, MEMCACHED, ELASTICSEARCH.
after_action_idIntegerThe numerical ID of the action, after which this action should be added.
variablesVariable []The list of variables defined for this action.

Example

Request

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

JSON

{
"name": "Build application",
"type": "BUILD",
"trigger_time": "ON_EVERY_EXECUTION",
"docker_image_name": "private_image",
"docker_image_tag": "latest",
"mount_filesystem_path": "/buddy/git-repo",
"execute_commands": [
"ls -al > ls.log"
],
"variables": [
{
"key": "ftp_login",
"value": "userLogin123",
"description": "The name of user to FTP.",
"encrypted": false,
"settable": false
},
{
"key": "ftp_password",
"value": "secure!14ivLMxPgv7TX6c9+ITX/g==",
"description": "The password for ftp.",
"encrypted": true
}
]
"integration": {
"id": 10
},
"region": "us-east-1"
}

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/actions/2",
"html_url": "https://app.buddy.works/buddy/company-website/pipelines/action/2/edit",
"id": 2,
"name": "Build application",
"type": "BUILD",
"trigger_time": "ON_EVERY_EXECUTION",
"last_execution_status": "INITIAL",
"run_only_on_first_failure": false,
"docker_image_name": "private_image",
"docker_image_tag": "latest",
"mount_filesystem_path": "/buddy/git-repo",
"execute_commands": [
"ls -al > ls.log"
],
"variables": [
{
"key": "ftp_login",
"value": "userLogin123",
"description": "The name of user to FTP.",
"encrypted": false,
"settable": false
},
{
"key": "ftp_password",
"value": "secure!14ivLMxPgv7TX6c9+ITX/g==",
"description": "The password for ftp.",
"encrypted": true
}
]
"integration": {
"id": 10
},
"region": "us-east-1"
"pipeline": {
"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": "Live mirror",
"trigger_mode": "MANUAL",
"ref_name": "master",
"last_execution_status": "SUCCESSFUL",
"last_execution_revision": "506a3963507943d6908154f4bc9646e829128a08"
}
}