diff options
| author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-18 15:21:51 -0500 |
|---|---|---|
| committer | Phil Hughes <me@iamphill.com> | 2016-06-13 11:01:19 +0100 |
| commit | aea4041ce96f18afea70da15af3cbe1be4fa1f94 (patch) | |
| tree | 7d2fe32a2e20ed9cd7f80bf07aefa5bcb37e7bb7 /lib/ci | |
| parent | 7a1b2e4f94e3e651d3264aa566a9056fe0f554e9 (diff) | |
| download | gitlab-ce-aea4041ce96f18afea70da15af3cbe1be4fa1f94.tar.gz | |
Allow to expire build artifacts
Diffstat (limited to 'lib/ci')
| -rw-r--r-- | lib/ci/api/builds.rb | 2 | ||||
| -rw-r--r-- | lib/ci/gitlab_ci_yaml_processor.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb index 607359769d1..54f5626c7d7 100644 --- a/lib/ci/api/builds.rb +++ b/lib/ci/api/builds.rb @@ -114,6 +114,7 @@ module Ci # id (required) - The ID of a build # token (required) - The build authorization token # file (required) - Artifacts file + # expire_in (optional) - Specify when artifacts should expire (ex. 7d) # Parameters (accelerated by GitLab Workhorse): # file.path - path to locally stored body (generated by Workhorse) # file.name - real filename as send in Content-Disposition @@ -145,6 +146,7 @@ module Ci build.artifacts_file = artifacts build.artifacts_metadata = metadata + build.artifacts_expire_at = Time.now + ChronicDuration.parse(params['expire_in']) if build.save present(build, with: Entities::BuildDetails) diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 15d57a46eb0..b1297565ebe 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -9,7 +9,7 @@ module Ci :allow_failure, :type, :stage, :when, :artifacts, :cache, :dependencies, :before_script, :after_script, :variables] ALLOWED_CACHE_KEYS = [:key, :untracked, :paths] - ALLOWED_ARTIFACTS_KEYS = [:name, :untracked, :paths, :when] + ALLOWED_ARTIFACTS_KEYS = [:name, :untracked, :paths, :when, :expire_in] attr_reader :before_script, :after_script, :image, :services, :path, :cache |
