Install repository

Install a repository on your site.


POST/api/servers/{server}/sites/{site}/repository

Install repository

This endpoint allows you to install a repository on your site.

Required parameters

  • Name
    provider
    Type
    string
    Description

    The repository provider. Must be: bitbucket, github, gitlab, or custom.

  • Name
    branch
    Type
    string
    Description

    The branch to use for deployments.

  • Name
    name
    Type
    string
    Description

    Either username/repository or a custom GIT URL ending with .git.

Optional parameters

  • Name
    source_provider_id
    Type
    integer
    Description

    The ID of the connected source control account to use. Required when you have multiple accounts linked for the same provider (e.g. several GitHub accounts) and want to choose a specific one. When omitted, the first linked account matching provider is used. Retrieve the available IDs from the List source control providers endpoint.

  • Name
    install_composer
    Type
    boolean
    Description

    Whether to run composer install as part of the deployment after the repository is installed.

Request

POST
/api/servers/{server}/sites/{site}/repository
curl -X POST "https://ploi.io/api/servers/{server}/sites/{site}/repository" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "provider": "github",
    "branch": "master",
    "name": "user/repository",
    "source_provider_id": 1
  }'

Response

{
  "data": {
    "id": 90,
    "domain": "domain.com",
    "web_directory": "/public",
    "wordpress": false,
    "laravel": false,
    "project_root": "/",
    "last_deploy_at": "2018-09-14 20:36:05",
    "created_at": "2018-09-14 11:40:01",
    "repository": {
      "branch": "master",
      "user": "username",
      "provider": "bitbucket"
    }
  }
}