Skip to content

Commit

Permalink
Move tmp artifacts to shared/artifacts/tmp/. Check for GitLab-Workhor…
Browse files Browse the repository at this point in the history
…se now
  • Loading branch information
ayufan committed Nov 10, 2015
1 parent 97f58ba commit 445cdb7
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ public/assets/
public/uploads.*
public/uploads/
shared/artifacts/
shared/tmp/artifacts-uploads/
shared/tmp/artifacts-cache/
rails_best_practices_output.html
/tags
tmp/
Expand Down
4 changes: 2 additions & 2 deletions app/uploaders/artifact_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ def self.artifacts_path
end

def self.artifacts_upload_path
File.expand_path('shared/tmp/artifacts-uploads/', Rails.root)
File.expand_path('shared/artifacts/tmp/uploads/', Rails.root)
end

def self.artifacts_cache_path
File.expand_path('shared/tmp/artifacts-cache/', Rails.root)
File.expand_path('shared/artifacts/tmp/cache/', Rails.root)
end

def initialize(build, field)
Expand Down
2 changes: 0 additions & 2 deletions doc/install/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,6 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da

# Change the permissions of the directory where CI artifacts are stored
sudo chmod -R u+rwX shared/artifacts/
sudo chmod -R u+rwX shared/tmp/artifacts-uploads/
sudo chmod -R u+rwX shared/tmp/artifacts-cache/

# Copy the example Unicorn config
sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
Expand Down
2 changes: 1 addition & 1 deletion lib/api/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def authorize_admin_project
end

def require_gitlab_workhorse!
unless headers['Gitlab-Git-Http-Server'].present? || headers['GitLab-Git-HTTP-Server'].present?
unless env['HTTP_GITLAB_WORKHORSE'].present?
forbidden!('Request should be executed via GitLab Workhorse')
end
end
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion spec/requests/ci/api/builds_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
let(:post_url) { ci_api("/builds/#{build.id}/artifacts") }
let(:delete_url) { ci_api("/builds/#{build.id}/artifacts") }
let(:get_url) { ci_api("/builds/#{build.id}/artifacts") }
let(:headers) { { "Gitlab-Git-Http-Server" => "1.0" } }
let(:headers) { { "GitLab-Workhorse" => "1.0" } }
let(:headers_with_token) { headers.merge(Ci::API::Helpers::BUILD_TOKEN_HEADER => build.project.token) }

describe "POST /builds/:id/artifacts/authorize" do
Expand Down

0 comments on commit 445cdb7

Please sign in to comment.