cPanel/VersionControlDeployment
cPanel module

VersionControlDeployment

3 functions, invoked through the cpanel_uapi tool.

scope cpanel:uapi
Call any function with cpanel_uapi(service_id, module="VersionControlDeployment", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.

create GET#

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.

repository_rootstringRequired
The repository's directory.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

deploy_idstring
The deployment ID number.
log_pathstring
The absolute path to the task's log file vc_TIMESTAMP_git_deploy.log, where TIMESTAMP represents the time in Unix epoch time.
repository_rootstring
The repository's directory.
sse_urlstring
The SSE interface to track the progress of the deployment process.
task_idstring
The Task Queue system's task ID number.
timestampsobject
A hash of timestamps for the deployment process.
queuedstring
The time at which the deployment process. entered the task queue.

delete GET#

Delete Git deployment task

This function deletes a deployment task. For more information, read our Guide to Git - Deployment documentation.

deploy_idstringRequired
The Task Queue system's task ID number.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

Payload varies by call.

retrieve GET#

Return Git deployment task status

This function retrieves the status of deployment tasks. 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.

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.

No parameters.

Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:

deploy_idinteger
The deployment ID number.
log_pathstring
The absolute path to the task's log file.
repository_rootstring
The aboslute path to the cPanel-managed repository directory.
repository_stateobject
An object containing information about the repository's state at the time of deployment.
authorstring
The most-recent commit's author's name and email address as they exist in the user's Git configuration files.
branchstring
The repository's current branch.
dateinteger
The timestamp for the most-recent commit, in Unix time format.
identifierstring
The identifier (SHA-1 value) for the most-recent commit.
messagestring
The commit message.
sse_urlstring
The SSE interface to track the progress of the deployment process.
task_idstring
The Task Queue system's task ID number.
timestampsobject
An object containing timestamps for the deployment process.
activestring
The time at which the system started the deployment process, in Unix time format.
canceledstring
The time at which the system cancelled the deployment process, in Unix time format. Note: The function only returns this value if the system cancelled the deployment process. The system logs messages for this function in the ~/.cpanel/logs/vc_TIMESTAMP_git_deploy.log file, where TIMESTAMP represents the Unix timestamp.
failedstring
The time at which the deployment process failed, in Unix time format. Note: The function only returns this value if the deployment process failed. The system logs messages for this function in the ~/.cpanel/logs/vc_TIMESTAMP_git_deploy.log file, where TIMESTAMP represents the Unix timestamp.
queuedstring
The time at which the deployment process entered the task queue, in Unix time format.
succeededstring
The time at which the deployment process finished successfully, in Unix time format. Note: The function only returns this value if the deployment process succeeded.