Is Ruby / Rails the best way to run tasks after deployment?

We have a Ruby on Rails app with the EngineYard app cloud that works great for us. They provide a series of expandable callbacks (before_restart, after_restart, etc.) that are similar to Capistrano callbacks.

Our application has a series of Rake tasks that support various parts of the application. If we add a new business rule to the database, we may need to reload the business rules associated with them, etc.

These are tasks for which there is no hard or fast schedule, but we also do not want to run every task at each deployment, because they slow down the deployment process.

Are there any systems that will allow us to determine the task that will be performed during the next deployment, such as such migrations. The ideal system in my mind will work as follows:

  • We understand that the next time you deploy, the task must be started.
  • We plan a task through the system
  • At the next deployment, the system will see a list of tasks after deployment - he notices that the last of them has not yet been launched on a specific server (as in the way migrations migrate the database when they are launched, that only the most recent, uninitialized migrations are launched) - a new task starts

Any recommendations on best practices for planning these tasks after deployment and disabling them if they are not already running on the server?

Thank!

+3
2

  • / ... ? Rails, , rake db: migrate
  • , . schema_migrations, before_symlink.rb( - ) , , ?
+2

after_party , db: migrate, . (rake)

///20130130215258_task_name.rake

, , ruby ​​ rake. , ( async - , )

, , , .

+2

Source: https://habr.com/ru/post/1763793/


All Articles