docs/migrating.md in cpl-1.4.0 vs docs/migrating.md in cpl-2.2.0

- old
+ new

@@ -34,21 +34,21 @@ ```yaml my-app-staging: <<: *common setup_app_templates: - - gvc + - app - redis - memcached - rails - sidekiq ``` Note how the templates correspond to files in the `.controlplane/templates/` directory. These files will be used by the `cpl setup-app` and `cpl apply-template` commands. -Ensure that env vars point to the Heroku add-ons in the template for the app (`.controlplane/templates/gvc.yml`). See +Ensure that env vars point to the Heroku add-ons in the template for the app (`.controlplane/templates/app.yml`). See [this example](https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/.controlplane/templates/gvc.yml). After that, create a Dockerfile in `.controlplane/Dockerfile` for your deployment. See [this example](https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/.controlplane/Dockerfile). @@ -59,11 +59,11 @@ .controlplane/ Dockerfile # Your app's Dockerfile, with some Control Plane changes. controlplane.yml entrypoint.sh # App-specific - edit as needed. templates/ - gvc.yml + app.yml memcached.yml rails.yml redis.yml sidekiq.yml ``` @@ -91,11 +91,11 @@ # Build and push image with auto-tagging, e.g., "my-app-staging:1_456". cpl build-image -a my-app-staging --commit 456 # Prepare database. -cpl run:detached -a my-app-staging --image latest -- rails db:prepare +cpl run -a my-app-staging --image latest -- rails db:prepare # Deploy latest image. cpl deploy-image -a my-app-staging # Open app in browser. @@ -111,11 +111,11 @@ # Or build and push new image with sequential tagging and commit SHA, e.g., "my-app-staging:2_ABC". cpl build-image -a my-app-staging --commit ABC # Run database migrations (or other release tasks) with latest image, while app is still running on previous image. # This is analogous to the release phase. -cpl run:detached -a my-app-staging --image latest -- rails db:migrate +cpl run -a my-app-staging --image latest -- rails db:migrate # Deploy latest image. cpl deploy-image -a my-app-staging ``` @@ -190,11 +190,11 @@ ```yaml my-app-review: <<: *common match_if_app_name_starts_with: true setup_app_templates: - - gvc + - app - redis - memcached - rails - sidekiq ``` @@ -213,21 +213,21 @@ echo "export NEW_APP=true" >> $BASH_ENV fi # The `NEW_APP` env var that we exported above can be used to either reset or migrate the database before deploying. if [ -n "${NEW_APP}" ]; then - cpl run:detached 'LOG_LEVEL=warn rails db:reset' -a ${APP_NAME} --image latest + cpl run -a ${APP_NAME} --image latest -- rails db:reset else - cpl run:detached 'LOG_LEVEL=warn rails db:migrate_and_wait_replica' -a ${APP_NAME} --image latest + cpl run -a ${APP_NAME} --image latest -- rails db:migrate fi ``` Then follow the same steps for the initial deployment or code upgrades. ### Database for Review Apps For the review app resources, these should be handled as env vars in the template for the app -(`.controlplane/templates/gvc.yml`), .e.g.: +(`.controlplane/templates/app.yml`), .e.g.: ```yaml - name: DATABASE_URL value: postgres://postgres:XXXXXXXX@cpln-XXXX-staging.XXXXXX.us-east-1.rds.amazonaws.com:5432/APP_GVC ```