Copying Heroku Resources Through Pipeline
✓ Published0🌍 Public
Aalexfinnarn
Last edited Mar 15, 2021
Created on Mar 15, 2021
This example shows a bash script that automates copying Heroku resources between pipeline environments during a review app deployment. It detects whether the app is a review app using the `HEROKU_PR_NUMBER` environment variable, then resets and copies the PostgreSQL database from a staging app using `heroku pg:reset` and `heroku pg:copy`, parsing the `DATABASE_URL` with `IFS` and array splitting to extract the database name. It also fetches the Cloudinary URL from production via `heroku config:get`, sets it with Drush `state:set`, runs `drush cim` to import config changes, clears cache with `drush cr`, and triggers a test run via `curl`. The script uses bash string operations and Heroku CLI commands rather than a visualization library.
AI-generated description