diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-02-14 18:00:37 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-02-15 15:31:51 +0800 |
commit | d2d30cff552e08c4b7ec2b5e23acced8eb29cbcb (patch) | |
tree | 7d7c8055b57aee85426cd150c6f42dc1b7c0a675 /lib | |
parent | 1452729304393978ec93b712130dff6687db01b9 (diff) | |
download | gitlab-ce-d2d30cff552e08c4b7ec2b5e23acced8eb29cbcb.tar.gz |
Initial implementation for default artifacts expiration
TODO: Add tests and screenshots
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/settings.rb | 7 | ||||
-rw-r--r-- | lib/ci/api/builds.rb | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/api/settings.rb b/lib/api/settings.rb index 747ceb4e3e0..dabe6281755 100644 --- a/lib/api/settings.rb +++ b/lib/api/settings.rb @@ -56,7 +56,8 @@ module API given shared_runners_enabled: ->(val) { val } do requires :shared_runners_text, type: String, desc: 'Shared runners text ' end - optional :max_artifacts_size, type: Integer, desc: "Set the maximum file size each build's artifacts can have" + optional :max_artifacts_size, type: Integer, desc: "Set the maximum file size for each job's artifacts" + optional :default_artifacts_expiration, type: Integer, desc: "Set the default expiration time for each job's artifacts" optional :max_pages_size, type: Integer, desc: 'Maximum size of pages in MB' optional :container_registry_token_expire_delay, type: Integer, desc: 'Authorization token duration (minutes)' optional :metrics_enabled, type: Boolean, desc: 'Enable the InfluxDB metrics' @@ -117,7 +118,9 @@ module API :send_user_confirmation_email, :domain_whitelist, :domain_blacklist_enabled, :after_sign_up_text, :signin_enabled, :require_two_factor_authentication, :home_page_url, :after_sign_out_path, :sign_in_text, :help_page_text, - :shared_runners_enabled, :max_artifacts_size, :max_pages_size, :container_registry_token_expire_delay, + :shared_runners_enabled, :max_artifacts_size, + :default_artifacts_expiration, :max_pages_size, + :container_registry_token_expire_delay, :metrics_enabled, :sidekiq_throttling_enabled, :recaptcha_enabled, :akismet_enabled, :admin_notification_email, :sentry_enabled, :repository_storage, :repository_checks_enabled, :koding_enabled, :plantuml_enabled, diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb index 8b939663ffd..7aad6c50b7b 100644 --- a/lib/ci/api/builds.rb +++ b/lib/ci/api/builds.rb @@ -167,7 +167,7 @@ module Ci build.artifacts_file = artifacts build.artifacts_metadata = metadata - build.artifacts_expire_in = params['expire_in'] + build.set_artifacts_expire_in(params['expire_in']) if build.save present(build, with: Entities::BuildDetails) |