📌 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.
Figure 15: Git Push-to-Deploy manager showing repository settings, webhook endpoints, and build scripts.
🖥️ Interface Tour & Elements
- Clone & Deploy Repository Card: Input form to link a Git repository URL (HTTPS or SSH), designate the deployment branch, and set the target directory.
- Push-to-Deploy Webhook Endpoint: Unique webhook URL and secret token to paste into GitHub/GitLab webhook settings.
- Deployment Shell Script Editor: Script area defining commands to execute immediately after
git pullcompletes. - 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
- In the sidebar, click Git Manager (icon:
fab fa-git-alt). - 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.
mainorproduction). - Deployment Directory: Select your target folder (e.g.
public_html).
- Repository URL: Paste your repository URL (e.g.
- Click Clone & Deploy Repository. The server executes
git cloneinto the designated folder.
Step 2: Configuring the Webhook in GitHub / GitLab
- Copy the Push-to-Deploy Webhook URL generated in the panel.
- Go to your GitHub Repository -> Settings -> Webhooks -> Add Webhook.
- Paste the URL into Payload URL.
- Set Content type to
application/json. - Select Just the push event and click Add webhook.
Step 3: Setting Up a Post-Deployment Script
- In the BoostonCP Git Manager, locate the Deployment Script box.
- Enter your build steps:
composer install --no-dev --optimize-autoloader php artisan config:cache php artisan route:cache - 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:clearor restarting the app) in your post-deployment script.