Create Git deployment task

This function deploys the changes from a cPanel-managed repository.

Important:

The system logs messages for this function in the ~/.cpanel/logs/vc_TIMESTAMP_git_deploy.log file, where TIMESTAMP represents the time in Unix epoch time. The system pulls changes with the --ff-only option and will only succeed if the branch's HEAD commit is up-to-date or Git can fast forward it. For more information about our suggested deployment configuration and how users can set it up, read our Guide to Git™ - Deployment documentation. Before deployment, repositories must meet the following requirements:

  • A valid checked-in .cpanel.yml file in the top-level directory.
  • One or more local or remote branches.
  • A clean working tree.

If a repository does not meet these requirements, the system will not display deployment information. Also, it will disable deployment functionality. For more information, read our Guide to Git™ - Deployment documentation.

SecurityBasicAuth
Request
query Parameters
repository_root
required
string <path>

The repository's directory.

Example: repository_root=/home/user/public_html/example
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/VersionControlDeployment/create
Request samples
uapi --output=jsonpretty \
  --user=username \
  VersionControlDeployment \
  create \
  repository_root='/home/user/public_html/example'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "create",
  • "module": "VersionControlDeployment",
  • "result": {
    • "data": {
      • "deploy_id": "12",
      • "log_path": "/home/user/.cpanel/logs/vc_1525289545.785367_git_deploy.log",
      • "repository_root": "/home/username/example",
      • "sse_url": "/sse/UserTasks/B3A27B96-51F7-11E8-92E3-CC90C4F823F0",
      • "task_id": "00000000/5a9ec8dd4c345d",
      • "timestamps": {
        • "queued": "1525289545.16293"
        }
      },
    • "errors": null,
    • "messages": null,
    • "metadata": { },
    • "status": 1,
    • "warnings": null
    }
}