Preview Deployments
Automatically create preview Odoo environments for GitHub pull requests.
Preview deployments create a temporary, neutralized copy of your Odoo service whenever a pull request is opened on a connected GitHub repository. This lets your team review addon changes on a live Odoo instance before merging.
#How it works
- A pull request is opened on a connected repository
- hav.sh automatically creates a neutralized copy of your service
- The PR's branch addons are deployed to the copy
- A preview URL is posted back to the pull request via GitHub Deployments
- When the PR is closed or merged, the preview is automatically destroyed
#Setting up preview deployments
#1. Connect a repository
Make sure the repository containing your Odoo addons is connected to your service.
#2. Enable previews for the repository
Open your service, go to the Repositories tab, and click the Enable Previews action on the repository you want to enable previews for. The "Previews" column will show an eye icon when enabled.
#3. Open a pull request
Create a pull request on the connected repository. hav.sh will automatically create a preview deployment and post the status to the PR via the GitHub App.
Your preview deployment is now set up. Every new PR will get its own isolated Odoo environment.
#Managing previews
#Viewing active previews
Open your service and go to the Preview Deployments tab. You'll see all previews with their:
- PR number (linked to GitHub)
- Branch name
- Status (Creating, Active, Updating, Failed, Destroyed)
- Preview URL
- Associated service
#Creating a preview manually
You can also create previews manually from the Preview Deployments tab by clicking Create Preview. Select the repository, enter the PR number and branch name, and hav.sh will create the preview.
#Destroying a preview
Previews are automatically destroyed when the PR is closed or merged. You can also destroy a preview manually by clicking the Destroy action on the preview deployment.
#What happens during preview creation
When a preview is created, hav.sh:
- Creates a full copy of your service (database + files)
- Neutralizes the copy to disable crons and external connections
- Overrides the branch for addons from the PR's repository to use the PR branch
- Posts a GitHub Deployment status with the preview URL
Preview copies are always neutralized. Crons and external connections are disabled to prevent unintended side effects.
#Lifecycle
| PR Event | Action |
|---|---|
| Opened / Reopened | Creates a new preview deployment |
| New commits pushed | Re-syncs and redeploys changed addons |
| Closed / Merged | Destroys the preview and cleans up resources |
#Important notes
- Each PR gets its own isolated preview — multiple PRs can have active previews simultaneously
- Previews are always neutralized to disable crons and external connections
- Preview services appear as type Preview in your service list
- Destroying a preview soft-deletes the service — it won't appear in your active services but can be found in the trash filter
- Previews can only be enabled on services that are not themselves copies or previews