oCoreoCore Docs

Deployments

Deploy code changes through the CI/CD pipeline with snapshot-based rollback support.

Deployments in oCore take your code from a Git repository and ship it to a running Odoo instance. Each deployment goes through a structured pipeline (build, push, restart) with real-time progress tracking, step-by-step logs, and automatic pre-deployment snapshots for safe rollback.

Deployment History

View deployment history and trigger new deployments.

Open in Dashboard

Triggering a Deployment

Deployments can be triggered three ways:

  1. Automatic -- Push to a mapped branch triggers a deployment via webhook
  2. Manual -- Click Deploy in the dashboard or call the API
  3. Rollback -- Revert to a previous deployment's snapshot

Manual Deployment

Open the project and navigate to the Deployments tab.

Click Deploy and specify the reference:

  • Branch -- Deploy the latest commit from a branch
  • Commit SHA -- Deploy a specific commit (up to 40 characters)
  • Tag -- Deploy a tagged release
  • Instance -- Optionally target a specific instance

Click Start Deployment. oCore enqueues the build job.

curl -X POST https://ocore.example.com/api/projects/{projectId}/deploy \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "branch": "main",
    "instanceId": "INSTANCE_UUID"
  }'
ocore deploy --project PROJECT_UUID --branch main

At Least One Reference Required

You must provide at least one of branch, commitSha, or tag. If you specify a branch, oCore deploys the latest commit on that branch.

Deployment Process

Each deployment goes through a structured pipeline of steps:

Pipeline Steps

StepDescription
Pre-deploy SnapshotCreates a database and filestore snapshot for rollback safety
Clone RepositoryClones the Git repository at the specified commit
Build ImageBuilds a Docker image with your custom modules
Push ImagePushes the image to the local registry on the server
Update ContainerStops the old container and starts the new one
Module UpdateRuns odoo -u for changed modules (if configured)
Health CheckVerifies the instance is responding after deployment

Each step records:

  • Status -- pending, running, completed, failed, or skipped
  • Output -- Build logs, error messages
  • Duration -- Time taken in milliseconds
  • Timestamps -- Start and completion times

Blue-Green Deployments

oCore uses a blue-green deployment pattern. The activeColor field indicates which container version is currently serving traffic (blue or green). During deployment, the new version starts on the alternate color and traffic switches only after the health check passes.

Monitoring Deployment Progress

Real-time Progress

The deployment detail page shows live step-by-step progress with streaming logs. Each step transitions through statuses in real time.

Deployment Detail

View full deployment details including commit information, timing, and step output:

curl https://ocore.example.com/api/projects/{projectId}/deployments/{deploymentId} \
  -H "Authorization: Bearer $TOKEN"

Response fields include:

FieldDescription
statusOverall deployment status
triggerTypeHow the deployment was triggered (manual, webhook, rollback)
branchThe deployed branch
commitShaThe deployed commit hash
commitMessageThe commit message
commitAuthorThe commit author
snapshotIdPre-deployment snapshot for rollback
stepsArray of pipeline step details
durationMsTotal deployment time in milliseconds

Deployment History

View all deployments for a project with pagination:

curl "https://ocore.example.com/api/projects/{projectId}/deployments?limit=20&offset=0" \
  -H "Authorization: Bearer $TOKEN"
ocore deploy list --project PROJECT_UUID --limit 20

The response includes the total count for pagination and each deployment's summary.

Rollback via Pre-Deploy Snapshots

Every deployment creates a pre-deploy snapshot capturing the database and filestore state. If a deployment introduces issues, roll back to the snapshot.

Rolling Back

Find the deployment you want to roll back in the deployment history.

Click Rollback or use the API with the deployment's snapshot ID.

oCore restores the database and filestore from the snapshot, reverts the container to the previous image, and restarts.

curl -X POST https://ocore.example.com/api/projects/{projectId}/rollback \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"deploymentId": "DEPLOYMENT_UUID"}'
ocore deploy rollback --deployment DEPLOYMENT_UUID

Snapshot Management

You can also manage snapshots directly:

  • List snapshots -- View all snapshots for an environment
  • Pin a snapshot -- Prevent automatic cleanup
  • Create manual snapshots -- Take a snapshot at any time without deploying
  • Estimate snapshot size -- Preview storage requirements
# List environment snapshots
curl https://ocore.example.com/api/environments/{environmentId}/snapshots \
  -H "Authorization: Bearer $TOKEN"

# Create a manual snapshot
curl -X POST https://ocore.example.com/api/environments/{environmentId}/snapshots \
  -H "Authorization: Bearer $TOKEN"

Snapshot Retention

Snapshots are automatically cleaned up based on your snapshot settings. Pin important snapshots to prevent deletion. Configure retention in the environment's snapshot settings.

Required Permissions

  • Triggering deployments requires manage:deployments permission
  • Viewing deployment history requires view:deployments permission
  • Rollback requires manage:environments permission
  • Permissions are scoped by project access

Troubleshooting

Deployment fails at "Build Image" step

  • Check the build output for Python dependency errors
  • Verify your requirements.txt or setup.py is correct
  • Ensure the Odoo version in your code matches the instance version
  • Check for Docker build context issues (large files, missing .dockerignore)

Deployment fails at "Health Check" step

  • The Odoo instance did not respond within the health check timeout
  • Check the instance logs for startup errors
  • Verify database connectivity
  • Look for module import errors in the Odoo log

Webhook not triggering deployments

  • Verify the webhook URL in your Git provider settings
  • Check that the branch has a mapping to an environment
  • View webhook delivery logs in GitHub/GitLab/Bitbucket
  • Use Reconfigure Webhook to regenerate

Rollback fails

  • Check that the pre-deploy snapshot still exists (not cleaned up)
  • Verify there is sufficient disk space for the restore operation
  • View rollback progress and logs in the deployment detail page

Deployment takes too long

  • Large Docker images increase build and push times
  • Use .dockerignore to exclude unnecessary files
  • Consider multi-stage Docker builds to reduce image size
  • Check server disk I/O and network bandwidth
Was this page helpful?