Transfer to a sandbox
POST Parameters
Name | Type | Description |
---|---|---|
action Required | String | The ID of the action. |
type Required | String | The type of the action. Must be set to DEPLOY_TO_SANDBOX . |
input_type | String | Defines whether the files are uploaded from the repository or from the pipeline filesystem. Can be one of SCM_REPOSITORY or BUILD_ARTIFACTS . |
local_path | String | The source path of the files to be uploaded. |
remote_path | String | The absolute or relative path on the sandbox where the files are uploaded. |
deployment_excludes | String[] | The paths and/or files that excluded from the upload. |
deployment_includes | String[] | The exceptions from the ignore patterns set in deployment_excludes . |
use_temporary_files | Boolean | The files will be uploaded with a "tmp" suffix that will be removed once the upload has finished. |
deletion_disabled | Boolean | When set to false , deletes files on the server that were deleted between revisions. |
user | String | The name of the local (to the sandbox server) user who uploads the files. |
sandbox_references Required | String | Defines the sandbox selection method. Available values: BY_TAGS , BY_NAME , BY_PROJECT , BY_DAYS , BY_ID , BY_ACTION . |
sandbox_id | String | ID of the sandbox to which the files are uploaded. Required when sandbox_references is set to BY_ID . |
referenced_action_id | Int | ID of the action that creates the target sandbox.Required when sandbox_references is set to BY_ACTION . |
referenced_sanbox_name | String | Name of the target sandbox. Required when sandbox_references is set to BY_NAME . |
tags | String[] | List of tags applied to the target sandbox. Required when sandbox_references is set to BY_TAGS . |
sandbox_project_id | Int | ID of the project with the target sandbox. Required when sandbox_references is set to BY_PROJECT . |
days | Int | Number of days passed since the creation of the target sandbox. One of 1 , 2 , 3 , 7 , 14 , 30 . Required when sandbox_references is set to BY_DAYS . |
Sample Request
POST https://api.buddy.works/workspaces/buddy/projects/company-website/pipelines/2/actions
JSON
{
"name": "Upload files to sandbox",
"type": "DEPLOY_TO_SANDBOX",
"input_type": "SCM_REPOSITORY",
"trigger_time": "ON_EVERY_EXECUTION",
"local_path": "/assets/",
"remote_path": "www/",
"deployment_excludes": [
"/tmp/"
],
"deployment_includes": [
"/tmp/file.txt"
],
"deletion_disabled": true,
"use_temporary_files": true,
"user": "root",
"sandbox_id": "Cgn3QO34klUri",
"sandbox_references": [
"BY_ID"
]
}
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": "Upload files to sandbox",
"type": "DEPLOY_TO_SANDBOX",
"trigger_time": "ON_EVERY_EXECUTION",
"last_execution_status": "INITIAL",
"input_type": "SCM_REPOSITORY",
"local_path": "/assets/",
"remote_path": "www/",
"user": "user",
"sandbox_references": [
"BY_ID"
],
"sandbox_id": "Cgn3QO34klUri",
"deletion_disabled": true,
"use_temporary_files": true,
"deployment_excludes": [
"/tmp/"
],
"deployment_includes": [
"/tmp/file.txt"
],
"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"
}
}
Last modified on November 16, 2022