-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run run rake task only once on next deploy #2057
Comments
If this solves your problem, please feel free to close the issue: |
But it describes, how to run task manually, Not to Run Once automatically after next deploy only ( like rails migration
|
I'm sorry I'm confused, in the first post you asked:
Sounds like you don't want this coupled to a deploy. The easy way is to make use of rake task dependencies - https://subscription.packtpub.com/book/hardware_and_creative/9781783280773/1/ch01lvl1sec13/task-dependencies-prerequisites You can definitely hook in to an existing rake task, or extend the capistrano deploy task with an extra step (capistrano's tasks/steps DSL is literally just rake) |
yes, I understand that I can run any rake task on deploy, but it is possible to restrict run it only ONCE ? Looks, only if I add additional logic to redis or save to capistrano shared files, and check it, but may be it is possible with capistrano ? |
Delete the code after you ran it? Use a lockfile, or a locking key in Redis? |
I've written a task (and the supporting) to do this. The code is specific to our system (how we decided to record if a task has been run), but if you still need help or want info about this, let me know. |
Hi, is it possible to run custom command( ex: rake task ) only once on next deploy only?
I don't wan't to wait deploy, I want to run rake task only once ( On production for compatibility ), without running it manually and without rails migrations
The text was updated successfully, but these errors were encountered: