DigitalOcean App Engine + Magaged Database - Whitelisting delay

Normally, and ideally, you want to run certain processes automatically each deployment. For a laravel app, you can think of:

php artisan migrate for instance.

Adding apps as trusted sources has been added to App Engine, but from what I can tell, the IP-address is whitelist after the deployment has fully finished. This means, we can’t run any tasks that require database access during deployment, which is the often the case.

It would be great if this can be added towards the future, so that we can further optimize the build-pipeline and automate more processes.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi softwareRay,

You can run your migrations before every deploy by adding a Job component to your app.

  1. Visit the Apps management page in Cloud UI
  2. Click on your app
  3. Click Actions -> Create Component
  4. Choose the same repo and branch as your Laravel app and click Next
  5. In the Type section click Edit
  6. In the Type dropdown select Job
  7. In the When to Run select Before every deploy
  8. In the Run Command section click Edit
  9. Enter the run command and set it to php artisan migrate
  10. Click Next
  11. Choose the container size necessary for your migrations (the smallest one is usually enough for this task)
  12. Click Launch

From then on, every time you push a new commit to your app, migrations will be run before every deployment after a successful build.

Best, Moises

It actually seems the db environment variables for the database arent scoped for runtime. Why is this?

  • key: DATABASE_URL scope: RUN_TIME value: ${views.DATABASE_URL}