Welcome to mirror list, hosted at ThFree Co, Russian Federation.

workhorse.rake « gitlab « tasks « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 15084a118b7796615da1ac052e62f41b4e93a51a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
namespace :gitlab do
  namespace :workhorse do
    desc "GitLab | Workhorse | Install or upgrade gitlab-workhorse"
    task :install, [:dir, :repo] => :gitlab_environment do |t, args|
      warn_user_is_not_gitlab

      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

      args.with_defaults(repo: 'https://gitlab.com/gitlab-org/gitlab-workhorse.git')

      version = Gitlab::Workhorse.version

      checkout_or_clone_version(version: version, repo: args.repo, target_dir: args.dir, clone_opts: %w[--depth 1])

      _, status = Gitlab::Popen.popen(%w[which gmake])
      command = status == 0 ? 'gmake' : 'make'

      Dir.chdir(args.dir) do
        run_command!([command])
      end
    end
  end
end