Skip to content

Commit

Permalink
Implement pending_files method to detect failed AfterParty tasks and …
Browse files Browse the repository at this point in the history
…rename store_deploy_time
  • Loading branch information
MclPio committed Oct 15, 2024
1 parent fe0e42f commit 85280b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 29 deletions.
29 changes: 0 additions & 29 deletions lib/tasks/deployment/20340720232939_store_deploy_time.rake

This file was deleted.

14 changes: 14 additions & 0 deletions lib/tasks/deployment/99991023145114_store_deploy_time.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace :after_party do
desc "Deployment task: stores_the_time_of_the_latest_deploy_as_a_file"
task store_deploy_time: :environment do
puts "Running deploy task 'store_deploy_time'" unless Rails.env.test?
pending_files = AfterParty::TaskRecorder.pending_files

down_tasks = pending_files.reject { |item| item.task_name == "store_deploy_time" }
if down_tasks.empty?
Health.instance.update_attribute(:latest_deploy_time, Time.now)
else
puts("failed tasks found, latest_deploy_time will not be updated!")
end
end
end

0 comments on commit 85280b1

Please sign in to comment.