Deploy full-stack environments for every PR in under 10 minutes
If you’re using GitHub, GitLab, Bitbucket or Azure DevOps and want to streamline your development workflow, this post is for you.
Imagine this: every time a developer opens a pull request, a full environment spins up automatically — frontend, backend, database, services — the whole stack. It’s deployed in your cloud, seeded with test data, and ready for QA, product, or design to review.
No more “waiting for staging,” broken local setups, or delays in feedback.
In this tutorial, we’ll show you exactly how to do that using Bunnyshell — a platform built to automate preview environments with zero infrastructure overhead.
Why Preview Environments Are a Must in 2025
Modern dev teams — especially those using AI tools like GitHub Copilot, Cursor, or Windsurf — are generating more code, faster. But that doesn’t mean the code is better.
Without testing each PR in a clean, production-like environment, you're:
- Delaying QA
- Letting bugs slip through
- Slowing releases with last-minute surprises
Preview environments fix this by making every pull request instantly testable.
What You’ll Learn in This Guide
What is a Preview Environment?
✅ How to connect Bunnyshell to GitHub or GitLab
✅ How to configure your app to launch automatically for every PR
✅ How to share environments with QA, PMs, and stakeholders
✅ How to tear them down automatically after merge or close
Let’s dive in.
Step 1: Connect Your Git Repository
Bunnyshell supports:
- GitHub (Cloud + Enterprise)
- GitLab (Cloud + Self-hosted)
- Azure DevOps (Cloud + Enterprise)
- Bitbucket
Steps:
- Sign up at bunnyshell.com
- Choose “Connect git account”
- Authorize access to your GitHub or GitLab account
- Select the repo you want to enable preview environments for
✅ Done: Your app is now connected.
Step 2: Define Your Application Stack
You can define your app using:
- A docker-compose.yml
- Helm charts
- Kubernetes manifests
- Terraform (for infrastructure provisioning)
For example, let’s say you have a basic docker-compose.yml:
version: '3'
services:
frontend:
build: ./frontend
ports:
- 3000:3000
backend:
build: ./backend
ports:
- 4000:4000
db:
image: postgres:13
environment:
POSTGRES_PASSWORD: secret
Bunnyshell detects this automatically and builds a full environment per PR.
You can also use the visual builder to define services, configs, ports, and volumes if you prefer a UI over YAML.
Step 3: Enable Preview Environments per PR
Once your stack is defined:
- Go to the “Ephemeral Environment” section
- Toggle “Auto-create on pull request”
- Choose the branches or patterns (e.g. feature/*, main)
- Optionally set TTL (how long each environment should live)
- Define teardown rules (e.g. destroy on merge/close)
Bunnyshell will now:
- Detect PRs
- Build your app
- Deploy it in a clean, isolated namespace
- Expose it via a shareable link
Every. Single. Time.
Step 4: Test, Share, and Iterate
As soon as a PR is opened, your team gets:
- A URL to the full environment (e.g. pr-123.yourapp.dev)
- Real-time logs and status
- Optional integration with Slack or GitHub comments
✅ QA can test the feature immediately
✅ PMs can validate UX
✅ Designers can review UI in context
✅ Developers can catch integration bugs before merge
Step 5: Automate Cleanup and Save Resources
Preview environments are ephemeral — meaning they shut down automatically when you want them to.
You can configure:
- Auto-destroy on merge or PR close
- TTL (e.g. 4h, 24h, 3 days)
- Manual cleanup from dashboard or API
This keeps your infrastructure clean and your cloud bills low.
Summary: What You Get
✅ Full-stack preview environments in < 10 minutes
✅ Per-PR automation with GitHub/GitLab
✅ Zero custom scripts or infra
✅ Works with your existing codebase and stack
✅ A dramatically faster QA + feedback loop

Ready to Try It?
You can have this running today - no infra work, no DevOps team required.