# 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.

Endpoint: GET /VersionControlDeployment/create
Version: 11.136.0.4
Security: BasicAuth

## Query parameters:

  - `repository_root` (string, required)
    The repository's directory.
    Example: "/home/user/public_html/example"

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "create"

  - `module` (string)
    The name of the module called.
    Example: "VersionControlDeployment"

  - `result` (object)

  - `result.data` (object)

  - `result.data.deploy_id` (string)
    The deployment ID number.
    Example: "12"

  - `result.data.log_path` (string)
    The absolute path to the task's log file vc_TIMESTAMP_git_deploy.log, where TIMESTAMP represents the time in Unix epoch time.
    Example: "/home/user/.cpanel/logs/vc_1525289545.785367_git_deploy.log"

  - `result.data.repository_root` (string)
    The repository's directory.
    Example: "/home/username/example"

  - `result.data.sse_url` (string)
    The SSE interface to track the progress of the deployment process.
    Example: "/sse/UserTasks/B3A27B96-51F7-11E8-92E3-CC90C4F823F0"

  - `result.data.task_id` (string)
    The Task Queue system's task ID number.
    Example: "00000000/5a9ec8dd4c345d"

  - `result.data.timestamps` (object)
    A hash of timestamps for the deployment process.

  - `result.data.timestamps.queued` (string)
    The time at which the deployment process. entered the task queue.
    Example: "1525289545.16293"

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.status` (integer)
    - 1 - Success
- 0 - Failed: Check the errors field for more details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


