diff options
author | Robert Speicher <robert@gitlab.com> | 2017-03-21 15:32:58 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-03-21 15:32:58 +0000 |
commit | fc830c6ff5eaf2f74b573d54cbc745457f47c668 (patch) | |
tree | d0fc08d7e55c5d3a2c9f891c0663ee5ba4f5fa38 /lib/tasks | |
parent | 7afbb76162187bb9f77bb6f6e09c0fe0d85e928a (diff) | |
parent | 414ce0371c69458f0074367697104eae9db3898f (diff) | |
download | gitlab-ce-fc830c6ff5eaf2f74b573d54cbc745457f47c668.tar.gz |
Merge branch 'gitaly-install-rake' into 'master'
Docs and scripts to install Gitaly from source
Closes gitaly#136 and #28446
See merge request !9941
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/gitaly.rake | 23 | ||||
-rw-r--r-- | lib/tasks/gitlab/task_helpers.rb | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/lib/tasks/gitlab/gitaly.rake b/lib/tasks/gitlab/gitaly.rake new file mode 100644 index 00000000000..c288e17ac8d --- /dev/null +++ b/lib/tasks/gitlab/gitaly.rake @@ -0,0 +1,23 @@ +namespace :gitlab do + namespace :gitaly do + desc "GitLab | Install or upgrade gitaly" + task :install, [:dir] => :environment do |t, args| + warn_user_is_not_gitlab + unless args.dir.present? + abort %(Please specify the directory where you want to install gitaly:\n rake "gitlab:gitaly:install[/home/git/gitaly]") + end + + tag = "v#{Gitlab::GitalyClient.expected_server_version}" + repo = 'https://gitlab.com/gitlab-org/gitaly.git' + + checkout_or_clone_tag(tag: tag, repo: repo, target_dir: args.dir) + + _, status = Gitlab::Popen.popen(%w[which gmake]) + command = status.zero? ? 'gmake' : 'make' + + Dir.chdir(args.dir) do + run_command!([command]) + end + end + end +end diff --git a/lib/tasks/gitlab/task_helpers.rb b/lib/tasks/gitlab/task_helpers.rb index bb755ae689b..cdba2262bc2 100644 --- a/lib/tasks/gitlab/task_helpers.rb +++ b/lib/tasks/gitlab/task_helpers.rb @@ -81,7 +81,7 @@ module Gitlab def run_command!(command) output, status = Gitlab::Popen.popen(command) - raise Gitlab::TaskFailedError unless status.zero? + raise Gitlab::TaskFailedError.new(output) unless status.zero? output end |