diff options
| author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-14 16:19:29 +0200 |
|---|---|---|
| committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-14 16:19:29 +0200 |
| commit | 006b65098806fde2a467d9a79347d2978c992e89 (patch) | |
| tree | 344377e66de454b7be77f775cd37fcf41e0f6bc0 /app/controllers/projects | |
| parent | dc41a933f4f9a79e7160e38f248d33d7beb99bb6 (diff) | |
| parent | d4cd6dcaa024f8eca9089e67fb9b97022696d3e0 (diff) | |
| download | gitlab-ce-006b65098806fde2a467d9a79347d2978c992e89.tar.gz | |
Merge remote-tracking branch 'origin/master' into environments-and-deployments
# Conflicts:
# db/schema.rb
Diffstat (limited to 'app/controllers/projects')
| -rw-r--r-- | app/controllers/projects/artifacts_controller.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb index 832d7deb57d..f11c8321464 100644 --- a/app/controllers/projects/artifacts_controller.rb +++ b/app/controllers/projects/artifacts_controller.rb @@ -1,22 +1,18 @@ class Projects::ArtifactsController < Projects::ApplicationController layout 'project' before_action :authorize_read_build! + before_action :authorize_update_build!, only: [:keep] + before_action :validate_artifacts! def download unless artifacts_file.file_storage? return redirect_to artifacts_file.url end - unless artifacts_file.exists? - return render_404 - end - send_file artifacts_file.path, disposition: 'attachment' end def browse - return render_404 unless build.artifacts? - directory = params[:path] ? "#{params[:path]}/" : '' @entry = build.artifacts_metadata_entry(directory) @@ -34,8 +30,17 @@ class Projects::ArtifactsController < Projects::ApplicationController end end + def keep + build.keep_artifacts! + redirect_to namespace_project_build_path(project.namespace, project, build) + end + private + def validate_artifacts! + render_404 unless build.artifacts? + end + def build @build ||= project.builds.find_by!(id: params[:build_id]) end |
