theSteveMitchell / after_party

Automated post-deploy tasks for Ruby/Rails. Your deployment is the party. This is the after party
MIT License
241 stars 50 forks source link

Don't recommend commenting of TaskRecord.create #7

Open theSteveMitchell opened 10 years ago

theSteveMitchell commented 10 years ago

In the docs, we say you can have a deploy task run every deploy, if you comment the line that creates the TaskRecord. This is not a good suggestion, since we'll never know if the task ran at all.

shrirambalakrishnan commented 9 years ago

Asking this out of curiosity. How could a primary key column help us in this situation?

One idea I have is adding a boolean field in task_records table that could be set (or unset if running task during every deploy is not needed) while creating TaskRecord object.

theSteveMitchell commented 9 years ago

That's a good question. IIRC, I was was wanting to record an id and a date stamp in the database instead of the current scheme of recording only the version number. I think this would still require some Boolean flag, and We could accomplish the same thing without an id, by recording the version number and a date stamp. But I guess the point is, if we run tasks multiple times, I would want some auditing so I know every time it has been run.

In order to do this, I envisioned moving away from the rake DSL and using instead either active record classes or a more rails migration like class. And to me, that implied having an id column. So hopefully that answers your question.

That said, I don't really have a use case for running the same task multiple times. So if you have one, I'd love to hear your thoughts on that

shrirambalakrishnan commented 9 years ago

Thanks for your detailed description. Your thought process really clarified my doubt. Your idea of moving to rails migration like class for TaskRecord with timestamps and id seems nice to me since it is the convention. The timestamps might just present useful information.

To respond to your query of running the same task multiple times. Have been using your after_party for months and never had a need to run the same task multiple times.