Citizen Participation and Open Government application.
This is the open-source repository for decidim_staging, based on Decidim. This app is used to preview the latest staging
branch of Codegram's Decidim fork.
This application uses Heroku Review Apps to check new features individually and in isolation. In order to create a Review App:
- Go to the Actions tab
- Select Review app creator and click on Run workflow button
- Fill in the Decidim branch name with the name of your feature branch
- Optional: add the Decidim issue number
- Click Run workflow (This will trigger a deploy of a new Review App. You can check it in the Heroku dashboard. Also, when the deployment is finished, it will appear in the PR in this repo.)
- When the feature is reviewed close the PR (DO NOT MERGE IT!)
Using the "Review App creator" can give some problems with migrations. You can use the "App updater" workflow to update and existing Review App with the last changes from the Decidim branch. In order to do it:
- Go to the Actions tab
- Select App updater and click on Run workflow button
- Fill in the Decidim branch name with the name of your feature branch
- Click Run workflow
Also, there's an alternative: use bin/decidim_upgrade
(check master
branch if your branch doesn't have it). The downside is that it currently needs to be executed manually (clone the repo, checkout to your branch, run the command and commit&push the changes) but it won't give any problems with migrations.
If you need to re-seed the database:
- Install the Heroku CLI
- Wait until the app has been successfully deployed
heroku pg:reset --app decidim-staging-pr-<your PR ID>
heroku run rails db:migrate --app decidim-staging-pr-<your PR ID>
heroku run rails db:seed --app decidim-staging-pr-<your PR ID>
If you need to recreate the whole database (to remove or fix migrations):
rm db/schema.rb
rm db/migrate/*
rbenv exec bundle exec rake db:reset
rbenv exec bundle exec rake decidim:upgrade
rbenv exec bundle exec rake db:migrate
heroku pg:reset -a decidim-staging-pr-<your PR ID>
- Push your changes to the
decidim-staging
repository - Wait until the app has been successfully deployed
heroku run rails db:seed -a decidim-staging-pr-<your PR ID>