Clone a Tugboat Preview

Creates a clone of an existing preview. Clones are only allowed in projects that have base previews enabled.

Arguments

  • preview - Required
    The preview to clone.

  • label - Optional
    An optional human-readable label, or description, to give to the new preview.

Example

const args = { preview: '5ad6035e9e9e230001299fba' };
socket.emit('tugboat', 'previews', 'clone', args, callback);

Output

{
    "_id": "58cf4e012057230001ae530a",
    "updatedAt": "2017-03-20T03:35:40.112Z",
    "createdAt": "2017-03-20T03:35:29.073Z",
    "name": "master",
    "repo": "58cf4bfc457b92000138c33d",
    "token": "v0xq1vwswxtr7p3ubxhbfc4j",
    "data": {
        "github": {
            "ref": {
                "name": "master",
                "object": {
                    "url": "https://api.github.com/repos/TugboatQA/tugboat-test/git/commits/e741cf14f476dc3341068a0da022f623b24976b4",
                    "type": "commit",
                    "sha": "e741cf14f476dc3341068a0da022f623b24976b4"
                },
                "url": "https://api.github.com/repos/TugboatQA/tugboat-test/git/refs/heads/master",
                "ref": "refs/heads/master"
            }
        }
    },
    "build_begin": "2017-03-20T03:35:29.620Z",
    "default_service": "58cf4e012057230001ae530b",
    "build_end": "2017-03-20T03:35:39.413Z",
    "size": 418248599,
    "hits": 0,
    "aliases": [],
    "url": [
        "https://master-v0xq1vwswxtr7p3ubxhbfc4j.dev.tugboat.qa",
        "http://master-v0xq1vwswxtr7p3ubxhbfc4j.dev.tugboat.qa"
    ],
    "anchor": false,
    "locked": false,
    "state": "ready",
    "scope": "tugboat",
    "id": "58cf4e012057230001ae530a"
}

Errors

  • 1000: Permision Denied
    Either the user requesting the clone does not have permission to do so, or the preview's project does not have base previews enabled.

  • 1015: No Preview ID Provided
    The required preview argument was not included in the request.

  • 1039: Unknown Preview
    The requested preview could not be found.

results matching ""

    No results matching ""