summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-04 21:07:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-04 21:07:54 +0000
commit2fd92f2dc784ade9cb4e1c33dd60cbfad7b86818 (patch)
tree7779f36689db97a46e0268a4aec1d49f283eb0c8 /scripts
parent42ca24aa5bbab7a2d43bc866d9bee9876941cea2 (diff)
downloadgitlab-ce-2fd92f2dc784ade9cb4e1c33dd60cbfad7b86818.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/review_apps/automated_cleanup.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/review_apps/automated_cleanup.rb b/scripts/review_apps/automated_cleanup.rb
index 8a04d8e00bc..323a1deedfc 100755
--- a/scripts/review_apps/automated_cleanup.rb
+++ b/scripts/review_apps/automated_cleanup.rb
@@ -54,7 +54,7 @@ class AutomatedCleanup
end
def perform_gitlab_environment_cleanup!(days_for_stop:, days_for_delete:)
- puts "Checking for review apps not updated in the last #{days_for_stop} days..."
+ puts "Checking for Review Apps not updated in the last #{days_for_stop} days..."
checked_environments = []
delete_threshold = threshold_time(days: days_for_delete)
@@ -84,7 +84,7 @@ class AutomatedCleanup
elsif deployed_at < stop_threshold
stop_environment(environment, deployment)
else
- print_release_state(subject: 'Review app', release_name: environment.slug, release_date: last_deploy, action: 'leaving')
+ print_release_state(subject: 'Review App', release_name: environment.slug, release_date: last_deploy, action: 'leaving')
end
checked_environments << environment.slug
@@ -94,9 +94,9 @@ class AutomatedCleanup
end
def perform_helm_releases_cleanup!(days:)
- puts "Checking for Helm releases not updated in the last #{days} days..."
+ puts "Checking for Helm releases that are FAILED or not updated in the last #{days} days..."
- threshold_day = threshold_time(days: days)
+ threshold = threshold_time(days: days)
releases_to_delete = []
@@ -104,7 +104,7 @@ class AutomatedCleanup
# Prevents deleting `dns-gitlab-review-app` releases or other unrelated releases
next unless release.name.start_with?('review-')
- if release.status == 'FAILED' || release.last_update < threshold_day
+ if release.status == 'FAILED' || release.last_update < threshold
releases_to_delete << release
else
print_release_state(subject: 'Release', release_name: release.name, release_date: release.last_update, action: 'leaving')
@@ -180,14 +180,14 @@ end
automated_cleanup = AutomatedCleanup.new
-timed('Review apps cleanup') do
- automated_cleanup.perform_gitlab_environment_cleanup!(days_for_stop: 2, days_for_delete: 3)
+timed('Review Apps cleanup') do
+ automated_cleanup.perform_gitlab_environment_cleanup!(days_for_stop: 5, days_for_delete: 6)
end
puts
timed('Helm releases cleanup') do
- automated_cleanup.perform_helm_releases_cleanup!(days: 3)
+ automated_cleanup.perform_helm_releases_cleanup!(days: 7)
end
exit(0)