blob: 70719648fc55e3965e45b9f482cf655b9f1430e3 (
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
26
27
|
# frozen_string_literal: true
namespace :gitlab do
require_relative Rails.root.join('metrics_server', 'dependencies')
require_relative Rails.root.join('metrics_server', 'metrics_server')
namespace :metrics_exporter do
REPO = 'https://gitlab.com/gitlab-org/gitlab-metrics-exporter.git'
desc "GitLab | Metrics Exporter | Install or upgrade gitlab-metrics-exporter"
task :install, [:dir] => :gitlab_environment do |t, args|
unless args.dir.present?
abort %(Please specify the directory where you want to install the exporter
Usage: rake "gitlab:metrics_exporter:install[/installation/dir]")
end
version = ENV['GITLAB_METRICS_EXPORTER_VERSION'] || MetricsServer.version
make = Gitlab::Utils.which('gmake') || Gitlab::Utils.which('make')
abort "Couldn't find a 'make' binary" unless make
checkout_or_clone_version(version: version, repo: REPO, target_dir: args.dir, clone_opts: %w[--depth 1])
Dir.chdir(args.dir) { run_command!([make]) }
end
end
end
|