This repo now includes cpflow scaffolding for:
- opt-in PR review apps
- automatic staging deploys from
main - manual promotion from staging to production
This app runs on SQLite in production and stores uploaded files on the local disk.
The Control Plane setup mirrors that:
.controlplane/templates/db.ymlcreates a persistent volume for/app/db.controlplane/templates/storage.ymlcreates a persistent volume for/app/storage.controlplane/templates/rails.ymlmounts both volumes into therailsworkload.controlplane/release_script.shrunsbin/rails db:preparebefore deploys switch images
The generated .controlplane/Dockerfile now installs Node.js alongside Ruby,
auto-installs JavaScript dependencies for npm/Yarn/pnpm projects, and leaves a
callable package-manager shim in place so assets:precompile can invoke
yarn or pnpm again in later build steps.
Before the app will boot on Control Plane, populate SECRET_KEY_BASE in the
generated secret dictionaries:
react-on-rails-migration-example-staging-secretsreact-on-rails-migration-example-review-secretsreact-on-rails-migration-example-production-secrets
cpflow setup-app creates those dictionaries automatically. You only need to
add a SECRET_KEY_BASE entry to each one before the first deploy.
Typical setup:
export APP_NAME=react-on-rails-migration-example-staging
cpflow setup-app -a "$APP_NAME"
cpflow build-image -a "$APP_NAME"
cpflow deploy-image -a "$APP_NAME" --run-release-phase
cpflow open -a "$APP_NAME"Set these in GitHub before enabling the generated cpflow-* workflows:
CPLN_TOKEN_STAGINGCPLN_TOKEN_PRODUCTIONCPLN_ORG_STAGINGCPLN_ORG_PRODUCTIONSTAGING_APP_NAME=react-on-rails-migration-example-stagingPRODUCTION_APP_NAME=react-on-rails-migration-example-productionREVIEW_APP_PREFIX=react-on-rails-migration-example-review
Optional:
STAGING_APP_BRANCH=mainPRIMARY_WORKLOAD=rails