Build and Deploy from Git
Who this is for
Users running git-source apps who want to understand how builds and deploys work, how to trigger them, and what options are available.
How Git-Source App Deploys Work
For apps with source: git, CloudAIPilot:
- SSH-es to the server.
- Clones or pulls the git repository.
- Builds a Docker image from the
Dockerfilein the repo. - Runs the new image, replacing the previous container.
For Compose+Git apps: pulls the repo and runs docker compose up -d.
Trigger a Deploy
Redeploy latest commit
- Open the app detail → Overview tab.
- Click Deploy (or Redeploy stack for compose apps).
- CloudAIPilot pulls the latest commit on the configured branch and rebuilds.
Deploy a specific commit
- Open the app detail → Overview tab.
- The Commit Picker shows the 20 most-recent commits on the configured branch.
- Click Deploy next to the commit you want to deploy.
See KB-04-07: Use the Commit Picker for details.
Build Configuration
| Field | Description | Default |
|---|---|---|
| Dockerfile path | Path to Dockerfile in the repo | Dockerfile |
| Git branch | Branch to build from | as set at creation |
| Git ref | Optional specific commit SHA for targeted deploy | latest on branch |
If your Dockerfile is not in the root of the repo, the path is set at app creation time. Editing it after creation is not yet available in the UI.
Build Process on the Server
CloudAIPilot runs:
git clone <repoUrl> --branch <gitBranch> /opt/cloudpilot/apps/<appId>/
cd /opt/cloudpilot/apps/<appId>/
docker build -t cloudpilot-app-<appId>:latest -f <dockerfilePath> .
docker stop <appId> && docker rm <appId>
docker run -d --name <appId> ... cloudpilot-app-<appId>:latest
Build logs are streamed in real time to the Activity Center.
Zero-Downtime Deploys
If zeroDowntimeEnabled is true and the app has a custom domain configured, CloudAIPilot performs a blue-green swap:
- Builds and starts the new container on a temporary port.
- Waits for the healthcheck to pass.
- Updates the Nginx proxy to point to the new container.
- Stops the old container.
This requires the healthPath to be configured on the app.
What Success Looks Like
After a deploy, the app's commitSha field updates to the latest commit. The Activity Center shows the build and run steps as completed. The app status shows running.
Common Issues and Fixes
| Issue | Likely cause | Fix |
|---|---|---|
| Build fails: "Dockerfile not found" | Wrong Dockerfile path | Update the path in the app's Git settings. |
| Build fails: "permission denied to repo" | Git account disconnected or expired | Reconnect the git account in Settings → Git. |
| Container fails after build | App crashes on start | Check logs — see KB-04-12: App Logs. |
Related Articles
- KB-04-07: Use the Commit Picker
- KB-04-11: Deployment History and Rollback
- KB-04-12: App Logs and Diagnose
- KB-04-13: Healthcheck Behavior