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:

  1. SSH-es to the server.
  2. Clones or pulls the git repository.
  3. Builds a Docker image from the Dockerfile in the repo.
  4. 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

  1. Open the app detail → Overview tab.
  2. Click Deploy (or Redeploy stack for compose apps).
  3. CloudAIPilot pulls the latest commit on the configured branch and rebuilds.

Deploy a specific commit

  1. Open the app detail → Overview tab.
  2. The Commit Picker shows the 20 most-recent commits on the configured branch.
  3. Click Deploy next to the commit you want to deploy.

See KB-04-07: Use the Commit Picker for details.


Build Configuration

FieldDescriptionDefault
Dockerfile pathPath to Dockerfile in the repoDockerfile
Git branchBranch to build fromas set at creation
Git refOptional specific commit SHA for targeted deploylatest 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:

  1. Builds and starts the new container on a temporary port.
  2. Waits for the healthcheck to pass.
  3. Updates the Nginx proxy to point to the new container.
  4. 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

IssueLikely causeFix
Build fails: "Dockerfile not found"Wrong Dockerfile pathUpdate the path in the app's Git settings.
Build fails: "permission denied to repo"Git account disconnected or expiredReconnect the git account in Settings → Git.
Container fails after buildApp crashes on startCheck logs — see KB-04-12: App Logs.

Related Articles