📌 Purpose & Quick Summary

The Git Manager transforms BoostonCP into a modern CI/CD deployment environment. By connecting repositories from GitHub, GitLab, or Bitbucket, any git push to your main branch triggers an automated webhook deployment directly on your server. You can specify custom post-deployment bash commands (composer install, npm run build, php artisan migrate) ensuring zero manual deployment friction.

BoostonCP Git Manager Overview

Figure 15: Git Push-to-Deploy manager showing repository settings, webhook endpoints, and build scripts.


🖥️ Interface Tour & Elements

  1. Clone & Deploy Repository Card: Input form to link a Git repository URL (HTTPS or SSH), designate the deployment branch, and set the target directory.
  2. Push-to-Deploy Webhook Endpoint: Unique webhook URL and secret token to paste into GitHub/GitLab webhook settings.
  3. Deployment Shell Script Editor: Script area defining commands to execute immediately after git pull completes.
  4. Active Repositories Ledger: Table displaying linked repositories, active branch, last commit hash, Pull Now manual trigger, and Unlink button.

🛠️ Step-by-Step Instructions

Step 1: Connecting a Repository

  1. In the sidebar, click Git Manager (icon: fab fa-git-alt).
  2. In the Clone & Deploy Repository section:
    • Repository URL: Paste your repository URL (e.g. https://github.com/username/project.git).
    • Branch: Specify branch name (e.g. main or production).
    • Deployment Directory: Select your target folder (e.g. public_html).
  3. Click Clone & Deploy Repository. The server executes git clone into the designated folder.

Step 2: Configuring the Webhook in GitHub / GitLab

  1. Copy the Push-to-Deploy Webhook URL generated in the panel.
  2. Go to your GitHub Repository -> Settings -> Webhooks -> Add Webhook.
  3. Paste the URL into Payload URL.
  4. Set Content type to application/json.
  5. Select Just the push event and click Add webhook.

Step 3: Setting Up a Post-Deployment Script

  1. In the BoostonCP Git Manager, locate the Deployment Script box.
  2. Enter your build steps:
    composer install --no-dev --optimize-autoloader
    php artisan config:cache
    php artisan route:cache
  3. Click Save Script. Whenever you push code to GitHub, the server pulls the changes and executes these commands automatically.

⚙️ Complete Field & Parameter Reference Table

Setting Format Technical Function
Repository URL HTTPS / SSH URL Remote Git repository origin.
Branch e.g. main, master Git ref tracked for automated deployments.
Target Directory Directory path Folder on the server where repository working tree is deployed.
Webhook URL Unique HTTPS URL Inbound endpoint receiving push notifications from Git providers.
Deploy Script Bash commands Shell commands executed automatically post-pull under user permissions.

❓ Troubleshooting & Common Errors

1. Error: "Repository Clone Failed / Authentication Required"

  • Cause: The repository is private and no SSH deploy key was installed.
  • Solution: Copy your account's public SSH key from the Terminal -> SSH tab and add it as a Deploy Key in your GitHub repository settings.

2. Webhook Fired But Changes Not Visible

  • Cause: PHP OPcache or application cache is serving cached bytecode.
  • Solution: Include cache clearing commands (e.g. php artisan cache:clear or restarting the app) in your post-deployment script.