debian-mirror-gitlab/lib/tasks/gitlab/workhorse.rake

26 lines
848 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
namespace :gitlab do
namespace :workhorse do
2020-03-13 15:44:24 +05:30
desc "GitLab | Workhorse | Install or upgrade gitlab-workhorse"
2018-03-17 18:26:18 +05:30
task :install, [:dir, :repo] => :gitlab_environment do |t, args|
2017-08-17 22:00:37 +05:30
warn_user_is_not_gitlab
2018-03-17 18:26:18 +05:30
2017-08-17 22:00:37 +05:30
unless args.dir.present?
abort %(Please specify the directory where you want to install gitlab-workhorse:\n rake "gitlab:workhorse:install[/home/git/gitlab-workhorse]")
end
2018-03-17 18:26:18 +05:30
2017-08-17 22:00:37 +05:30
args.with_defaults(repo: 'https://gitlab.com/gitlab-org/gitlab-workhorse.git')
version = Gitlab::Workhorse.version
2020-05-24 23:13:21 +05:30
checkout_or_clone_version(version: version, repo: args.repo, target_dir: args.dir, clone_opts: %w[--depth 1])
2017-08-17 22:00:37 +05:30
_, status = Gitlab::Popen.popen(%w[which gmake])
2020-10-24 23:57:45 +05:30
command = status == 0 ? 'gmake' : 'make'
2017-08-17 22:00:37 +05:30
Dir.chdir(args.dir) do
run_command!([command])
end
end
end
end