[sysadmin-bin] Add script for expiring GitLab artifacts older than 1 month
- From: Bartłomiej Piotrowski <bpiotrowski src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] Add script for expiring GitLab artifacts older than 1 month
- Date: Mon, 10 May 2021 12:11:08 +0000 (UTC)
commit 2557d7a2152c451baeda2195d862b493f5a41b24
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date: Mon May 10 14:11:02 2021 +0200
Add script for expiring GitLab artifacts older than 1 month
gitlab/expire-artifacts.rb | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/gitlab/expire-artifacts.rb b/gitlab/expire-artifacts.rb
new file mode 100644
index 0000000..36b0334
--- /dev/null
+++ b/gitlab/expire-artifacts.rb
@@ -0,0 +1,6 @@
+builds_with_artifacts = Ci::Build.with_downloadable_artifacts
+builds_to_clear = builds_with_artifacts.where("finished_at < ?", 1.month.ago)
+builds_to_clear.find_each do |build|
+ build.artifacts_expire_at = Time.now
+ build.erase_erasable_artifacts!
+end
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]