Refresh a Tugboat Preview

Updates the preview's code from git, and runs the tugboat-update Makefile target.

Arguments

  • preview - Required
    The preview to refresh.

Example

socket.emit('tugboat', 'previews', 'refresh', args, callback);

Output

single

{
    "_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"
}

array

[
    {
        "_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"
    }
]

In addition to the final output, "log" events are emmitted as the preview is refreshed. These log events include "level" and "message" fields, and look like the following:

{
    "preview": "58bdc0fd455e930001c14805",
    "level": "info",
    "message": "Preview Log Entry"
}

Errors

  • 1014: No Previews Found
    Returned if the requested previews do not exist, or the requestor does not have permission to refresh them.

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

results matching ""

    No results matching ""