Page tree
Skip to end of metadata
Go to start of metadata

Overview

If you wish to deploy the contents of a cPanel-managed repository on a schedule, you can set up deployment cron jobs. Cron jobs allow you to configure the system to run a specified command automatically at a specified interval.

For more information about deployment, read our Guide to Git - Deployment documentation.

Set up deployment cron jobs


Locate the repository's directory.

In order to configure your deployment cron job, you must use the correct repository path.

To locate the desired repository's directory, navigate to cPanel's Git Version Control interface (cPanel >> Home >> Files >> Git Version Control). Then, in the list of repositories, locate the Repository Path value for the desired repository.



 

Use the Cron Jobs interface to configure your cron job.

The Cron Jobs interface (cPanel >> Home >> Advanced >> Cron Jobs) allows you to configure cron jobs.

To configure your deployment cron job, perform the following steps:

  1. Select the interval at which you wish to run the cron job. You can select a commonly-used interval from the Common Settings menu, or select or enter a specific interval for the following values:
    • Minute — The number of minutes between each time that the cron job runs or the minute of each hour on which you wish to run the cron job.

    • Hour — The number of hours between each time that the cron job runs or the hour of each day on which you wish to run the cron job.
    • Day — The number of days between each time that the cron job runs or the day of the month on which you wish to run the cron job.
    • Month — The number of months between each time that the cron job runs or the month in which you wish to run the cron job.
    • Weekday — The days of the week on which you wish to run the cron job.

  2. In the Command text box, enter the commands that you wish the system to run. Begin these commands with the following command, where /home/user/example represents the repository's Repository Path value:

    /usr/bin/uapi VersionControlDeployment create repository_root=/home/user/example

    This command calls UAPI's VersionControlDeployment::create function, which creates a new deployment task. This task will run the deployment commands that you specified in your .cpanel.yml file once.

  3. Click Add New Cron Job.

Additional documentation

Error rendering macro 'contentbylabel' : parameters should not be empty

There is no content with the specified labels