Create a Tugboat Repository

Arguments

  • project - Required
    The ID of a project that should be the repository's parent. A value of 0 means there should be no parent project. The API key used to make the request must be a Tugboat Admin in order to set this value to 0.
  • name - Optional
    A human-readable name to associate with the repository.
  • provider - Optional
    Which provider to use for this repository. Valid options are bitbucket, git, github, gitlab, or stash. Default: git.

  • users - Optional
    A list of API Key IDs that should have user-level access to the repository. This can be a single ID, or an array of IDs.

  • admins - Optional
    A list of API Key IDs that should have admin-level access to the repository. This can be a single ID, an array of IDs.
  • quota - Optional
    A disk quota in GB to impose on the repository. A quota of 0 means that there is no quota. If this quota is larger than the quota set on the repository's parent project, the project's quota takes priority. Likewise, if the sum of the quotas of all of the repositories in a project is larger than the project's quota, the project's quota is enforced.
  • ssh_private - Optional
    The private half of an SSH key pair to use for previews created in this repository.
  • agent - Optional
    Which Tugboat Agent to assign the repository to. If not specified, or if permissions do not allow setting this property, the project's default agent is used if it has one. Otherwise, the agent with the most available resources is automatically chosen. The API key used to make the request must be a Tugboat Admin in order to set this value.

Example

socket.emit('tugboat', 'repos', 'create', args, callback);

Output

When a Tugboat Repository is successfully created, an object containing that repository's details is returned.

single

{
    "updatedAt": "2017-02-17T20:33:38.452Z",
    "createdAt": "2017-02-17T20:33:38.452Z",
    "name": "my-github-project",
    "agent": "dev.tugboat.qa",
    "_id": "58a75e22ddccc30001a26086",
    "size": 0,
    "quota": 0,
    "admins": [],
    "users": [],
    "project": "58a758b534f0210001cf9439",
    "id": "58a75e22ddccc30001a26086"
}

array

[
    {
        "updatedAt": "2017-02-17T20:33:38.452Z",
        "createdAt": "2017-02-17T20:33:38.452Z",
        "name": "my-github-project",
        "agent": "dev.tugboat.qa",
        "_id": "58a75e22ddccc30001a26086",
        "size": 0,
        "quota": 0,
        "admins": [],
        "users": [],
        "project": "58a758b534f0210001cf9439",
        "id": "58a75e22ddccc30001a26086"
    }
]

Errors

  • 1005: No Repositories Found
    Returned if the requested repositories could not be created.

results matching ""

    No results matching ""