DevOps

CI/CD Integration

Automate your Odoo deployments with GitHub and GitLab integration.

Overview

Nurosentrix supports CI/CD integration through webhooks. When you push code to your repository, Nurosentrix can automatically deploy the changes to your Odoo instances.

Supported Platforms

  • GitHub
  • GitLab

GitHub Integration

Step 1: Create a Webhook

  1. Go to your GitHub repository → Settings → Webhooks
  2. Click "Add webhook"
  3. Configure:
    • Payload URL: Copy from Nurosentrix instance settings
    • Content type: application/json
    • Secret: Generate in Nurosentrix
  4. Select events: "Just the push event"
  5. Click "Add webhook"

Step 2: Configure in Nurosentrix

  1. Go to your instance → Settings → CI/CD
  2. Click "Connect Repository"
  3. Select "GitHub"
  4. Enter:
    • Repository URL
    • Branch to deploy (e.g., main, production)
    • Modules path (e.g., addons/)
  5. Copy the webhook URL and secret
  6. Configure the webhook in GitHub (Step 1)
  7. Click "Save"

GitLab Integration

Step 1: Create a Webhook

  1. Go to your GitLab project → Settings → Webhooks
  2. Configure:
    • URL: Copy from Nurosentrix instance settings
    • Secret token: Generate in Nurosentrix
  3. Select trigger: "Push events"
  4. Click "Add webhook"

Step 2: Configure in Nurosentrix

  1. Go to your instance → Settings → CI/CD
  2. Click "Connect Repository"
  3. Select "GitLab"
  4. Enter:
    • Repository URL
    • Branch to deploy
    • Modules path
  5. Copy the webhook URL and secret
  6. Configure the webhook in GitLab (Step 1)
  7. Click "Save"

Deployment history and webhook status are visible under Instance → Deployments.

Deployment Process

When a push is received, Nurosentrix:

  1. Verifies the webhook signature
  2. Checks if the push is to the configured branch
  3. Creates a pre-deployment backup
  4. Pulls the latest code
  5. Updates Odoo modules
  6. Restarts the instance if needed

Configuration Options

Deployment Settings

SettingDescription
Auto-deployAutomatically deploy on every push
Branch filterOnly deploy from specific branches
Pre-deploy backupCreate backup before deployment
Update modulesRun -u all after deployment
Restart instanceRestart Odoo after deployment

Module Path Configuration

Specify where your custom modules are located in the repository:

# Common structures:
addons/           # Modules in addons folder
custom_addons/    # Modules in custom_addons folder
.                 # Modules in repository root

# Multiple paths (comma-separated):
addons/,custom_addons/,third_party/

Deployment Logs

View deployment history and logs:

  1. Go to your instance → Deployments
  2. Click on a deployment to see details
  3. View:
    • Commit message and SHA
    • Deployment status
    • Duration
    • Logs output

Rollback

If a deployment causes issues:

  1. Go to your instance → Deployments
  2. Find the last working deployment
  3. Click "Rollback to this version"
  4. Confirm the rollback

This restores the code and database from the pre-deployment backup.

Example Repository Structure

my-odoo-modules/
├── addons/
│   ├── custom_crm/
│   │   ├── __init__.py
│   │   ├── __manifest__.py
│   │   ├── models/
│   │   └── views/
│   └── custom_sale/
│       ├── __init__.py
│       ├── __manifest__.py
│       └── ...
├── .gitignore
└── README.md

Best Practices

  • Use separate branches for development and production
  • Test changes in a staging environment first
  • Keep pre-deployment backups enabled
  • Use descriptive commit messages
  • Review deployment logs after each push

Troubleshooting

Webhook Not Received

  • Check webhook URL is correct
  • Verify the secret matches
  • Check GitHub/GitLab webhook delivery logs
  • Ensure the webhook is enabled

Deployment Failed

  • Check deployment logs for specific errors
  • Verify module manifest files are valid
  • Ensure all dependencies are listed
  • Check for Python syntax errors

Module Not Updated

  • Verify the module path is correct
  • Check the manifest version was incremented
  • Try running module update manually