forked from rubyforgood/casa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rubyforgood#6067 from MclPio/main
Modify store_deploy_time.rake
- Loading branch information
Showing
2 changed files
with
14 additions
and
8 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
lib/tasks/deployment/99991023145114_store_deploy_time.rake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |