Preview Apps
Overview
Preview apps in Tapitalee are temporary copies of your application designed for testing features, pull requests, or experimental changes. They provide isolated environments that mirror your production setup while allowing safe testing without affecting your main application.
Resources copied from parent app on creation:
- Process configuration (eg. cpu/memory)
- Variable & secret values
- Commands
- Predeploy steps
- Add-ons optionally can be shared or you can create new ones per-preview-app
Subdomains for Preview Apps
It is a best practice to give each preview app its own subdomain. This can be achieved by creating a SecureProxy and Route53 Zone in the parent app, which will be automatically shared with the child preview apps.
Setup
- Register a domain for your preview apps (e.g.,
mypreviewsdomain.com) - Create a Route53 hosted zone for the domain in your parent app
- Add a wildcard domain to the parent app (e.g.,
*.mypreviewsdomain.com) so SecureProxy can handle traffic for it - Create SecureProxy in the parent app with Route53 integration (set DNS Challenge Provider to Route53)
- Add individual domains to each preview app (e.g.,
pr-1234.mypreviewsdomain.com)
SecureProxy will route traffic to the appropriate preview app and use the wildcard certificate to serve it over TLS.
Example
# In parent app: Create Route53 hosted zone
tapit create addon route53 domain=mypreviewsdomain.com
# In parent app: Create SecureProxy with Route53 DNS challenge
tapit create secureproxy acme_email=my@email.com dns_challenge_provider=route53
# Add wildcard domain to parent app
tapit create domain '*.mypreviewsdomain.com'
# Create preview app with its own subdomain
tapit create preview pr-1234-myapp domain=pr-1234.mypreviewsdomain.com
Use Cases
Development Workflow
- Pull Request Testing: Create preview apps for each PR to test changes
- Feature Development: Isolated environments for developing new features
- Stakeholder Review: Share working versions with non-technical stakeholders
Commands
Create Preview App
Create a preview app cloned from the current app’s configuration
tapit create preview <new_app_name> [domain=www.myapp.com] [delete_in_days=7] [-w|--wait]
Arguments
-
- Name for the new preview app
Parameters
domain: Custom domain to attach to the preview appdelete_in_days: Automatically delete the preview app after this many days-w|--wait: Wait for preview app creation to complete before returning
This happens under the umbrella of an existing app so it can share process and environment variable configuration, and add-ons (if shared).
Examples
# Create PR preview app
tapit create preview pr-123-myapp delete_in_days=14
# Feature branch testing
tapit create preview feature-auth-myapp domain=auth-test.myapp.com delete_in_days=30
# Quick testing environment
tapit create preview test-myapp delete_in_days=1 --wait
List Preview Apps
List all preview apps derived from the current app
tapit list previews
Delete Preview App
Delete a preview app derived from the current app
tapit delete preview <preview_app_name>
Arguments
-
- Name of the preview app to delete
Add-on Configuration
# Create separate database for preview app
tapit -a pr-123-myapp create addon rds name=preview-db
# Share add-ons from main app (cost-effective for testing)
tapit -a pr-123-myapp create shared-addon main-cache