Build application

  • POST
  • /workspaces
  • /:domain
  • /projects
  • /:project_name
  • /pipelines
  • /:pipeline_id
  • /actions

Request

URL PARAMETERS
domainrequired string
The workspace domain.
pipeline_idrequired integer
The numerical ID of the desired pipeline.
project_namerequired string
The name ID of the project.
POST PARAMETERS
servicesrequired Service

Last modified on Oct 7, 2024

Example: Build action

curl -X POST "https://api.buddy.works/workspaces/:domain/projects/:project_name/pipelines/:pipeline_id/actions" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Build application",
  "type": "BUILD",
  "trigger_time": "ON_EVERY_EXECUTION",
  "docker_image_name": "library/ubuntu",
  "docker_image_tag": "latest",
  "volume_mappings": [
    "/:/buddy/mount/directory"
  ],
  "execute_commands": [
    "ls -al > $fileName"
  ],
  "setup_commands": [
    "apt-get update -y",
    "apt-get install -y wget"
  ],
  "cached_dirs": [
    "/build/test",
    "/bin/Debug"
  ],
  "variables": [
    {
      "key": "fileName",
      "value": "ls.log"
    }
  ],
  "working_directory": "/buddy/my-repo-dir",
  "shell": "SH",
  "main_service_name": "my-app.svc",
  "cacheBaseImage": true,
  "services": [
    {
      "type": "MYSQL",
      "version": "5.7"
    },
    {
      "type": "MONGO_DB",
      "version": "3.2.4"
    }
  ]
}'
EXAMPLE RESPONSE
{ "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", "docker_image_name": "library/ubuntu", "docker_image_tag": "latest", "volume_mappings": [ "/:/buddy/mount/directory" ], "execute_commands": [ "ls -al > $fileName" ], "setup_commands": [ "apt-get update -y", "apt-get install -y wget" ], "cached_dirs": [ "/build/test", "/bin/Debug" ], "variables": [ { "key": "fileName", "value": "ls.log" } ], "working_directory": "/buddy/my-repo-dir", "shell": "SH", "main_service_name": "my-app.svc", "cacheBaseImage": true, "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", "refs": [ "refs/heads/master" ], "last_execution_status": "SUCCESSFUL", "last_execution_revision": "506a3963507943d6908154f4bc9646e829128a08" } }
STATUS
201 Created
LIMITS
X-Rate-Limit-Limit: 1 X-Rate-Limit-Remaining: 999

Example: Build action services

curl -X POST "https://api.buddy.works/workspaces/:domain/projects/:project_name/pipelines/:pipeline_id/actions" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Build application",
  "type": "BUILD",
  "trigger_time": "ON_EVERY_EXECUTION",
  "docker_image_name": "library/ubuntu",
  "docker_image_tag": "latest",
  "volume_mappings": [
    "/:/buddy/mount/directory"
  ],
  "execute_commands": [
    "ls -al > ls.log"
  ],
  "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",
      "volume_mappings": [
        "/:/buddy/mount/directory"
      ],
      "cached_dirs": [
        "/var/data/"
      ],
      "pass_variables": true,
      "entrypoint": "/bin/sh"
    },
    {
      "type": "MYSQL",
      "version": "5.7",
      "persistent": true,
      "connection": {
        "host": "mysql",
        "user": "root",
        "password": "root"
      },
      "pass_variables": true
    },
    {
      "type": "MARIADB",
      "version": "10.1.16",
      "persistent": true,
      "connection": {
        "host": "mariadb",
        "user": "root",
        "password": "root"
      },
      "pass_variables": true
    },
    {
      "type": "REDIS",
      "version": "3.2.1",
      "persistent": true,
      "connection": {
        "host": "redis"
      },
      "pass_variables": true
    },
    {
      "type": "MONGO_DB",
      "version": "3.2.4",
      "persistent": true,
      "connection": {
        "host": "mongo"
      },
      "pass_variables": true
    },
    {
      "type": "POSTGRE_SQL",
      "version": "9.5.3",
      "persistent": true,
      "connection": {
        "host": "postgres",
        "user": "root",
        "password": "root"
      },
      "pass_variables": true
    },
    {
      "type": "CASSANDRA",
      "version": "3.11",
      "persistent": true,
      "connection": {
        "host": "cassandra"
      },
      "pass_variables": true
    },
    {
      "type": "MEMCACHED",
      "version": "1.4.29",
      "connection": {
        "host": "memcached"
      },
      "pass_variables": true
    },
    {
      "type": "ELASTICSEARCH",
      "version": "2.3.4",
      "connection": {
        "host": "elasticsearch"
      },
      "pass_variables": true
    },
    {
      "type": "SELENIUM_FIREFOX",
      "version": "3.0.1",
      "connection": {
        "host": "selenium-ff"
      },
      "pass_variables": true
    },
    {
      "type": "SELENIUM_CHROME",
      "version": "3.0.1",
      "connection": {
        "host": "selenium-ch"
      },
      "pass_variables": true
    },
    {
      "type": "GANACHE",
      "version": "latest",
      "persistent": true,
      "connection": {
        "host": "ganache"
      },
      "gas_price": 20000000000,
      "gas_limit": 90000,
      "accounts": [
        "0xfd7ac8b32e8a2391cad323efd7b162d77dd9ca67806d09877552c38b618713a5:1000000000000000000"
      ],
      "pass_variables": true
    },
    {
      "type": "RABBIT_MQ",
      "version": "3.7.8",
      "persistent": true,
      "connection": {
        "host": "rabbitmq",
        "user": "guest",
        "password": "guest"
      },
      "pass_variables": true
    }
  ]
}'
EXAMPLE RESPONSE
{ "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", "docker_image_name": "library/ubuntu", "docker_image_tag": "latest", "volume_mappings": [ "/:/buddy/mount/directory" ], "execute_commands": [ "ls -al > ls.log" ], "services": [ { "type": "MYSQL", "version": "5.7", "persistent": true, "connection": { "host": "mysql", "port": 3306, "user": "root", "password": "root" }, "plugins": [], "pass_variables": true }, { "type": "MARIADB", "version": "10.1.16", "persistent": true, "connection": { "host": "mariadb", "port": 3306, "user": "root", "password": "root" }, "plugins": [], "pass_variables": true }, { "type": "REDIS", "version": "3.2.1", "persistent": true, "connection": { "host": "redis", "port": 6379 }, "plugins": [], "pass_variables": true }, { "type": "MONGO_DB", "version": "3.2.4", "persistent": true, "connection": { "host": "mongo", "port": 27017 }, "plugins": [], "pass_variables": true }, { "type": "POSTGRE_SQL", "version": "9.5.3", "persistent": true, "connection": { "host": "postgres", "port": 5432, "user": "root", "password": "root" }, "plugins": [], "pass_variables": true }, { "type": "CASSANDRA", "version": "3.11", "persistent": true, "connection": { "host": "cassandra", "port": 9042 }, "plugins": [], "pass_variables": true }, { "type": "MEMCACHED", "version": "1.4.29", "persistent": false, "connection": { "host": "memcached", "port": 11211 }, "plugins": [], "pass_variables": true }, { "type": "ELASTICSEARCH", "version": "2.3.4", "persistent": false, "connection": { "host": "elasticsearch", "port": 9200 }, "plugins": [], "pass_variables": true }, { "type": "SELENIUM_FIREFOX", "version": "3.0.1", "persistent": false, "connection": { "host": "selenium-ff", "port": 4444 }, "plugins": [], "pass_variables": true }, { "type": "SELENIUM_CHROME", "version": "3.0.1", "persistent": false, "connection": { "host": "selenium-ch", "port": 4444 }, "plugins": [], "pass_variables": true }, { "type": "GANACHE", "version": "latest", "persistent": true, "connection": { "host": "ganache", "port": 8545 }, "gas_price": 20000000000, "gas_limit": 90000, "accounts": [ "0xfd7ac8b32e8a2391cad323efd7b162d77dd9ca67806d09877552c38b618713a5:1000000000000000000" ], "pass_variables": true }, { "type": "RABBIT_MQ", "version": "3.7.8", "persistent": true, "connection": { "host": "rabbitmq", "port": 5672, "user": "guest", "password": "guest" }, "pass_variables": true } ], "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", "refs": [ "refs/heads/master" ], "last_execution_status": "SUCCESSFUL", "last_execution_revision": "506a3963507943d6908154f4bc9646e829128a08" } }
STATUS
201 Created
LIMITS
X-Rate-Limit-Limit: 1 X-Rate-Limit-Remaining: 999