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

s3-release « _support - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0a4ef7ecf315a36e299ec74bb496bad07074d649 (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
28
29
30
#!/usr/bin/env ruby
require 'fileutils'
require_relative 'run.rb'

RELEASE_DIR = '_support/release'
RELEASE_ID = capture!(%w[git log -1 --format=%H]).chomp

def main
  clean_release_dir
  [
    %w[linux amd64],
    %w[darwin amd64],
  ].each do |platform|
    build_platform(*platform)
  end
  FileUtils.cp('NOTICE', RELEASE_DIR)
  run!(%W[tar -zxvf gitaly-#{RELEASE_ID}.tar.gz])
end

def clean_release_dir
  FileUtils.rm_rf(RELEASE_DIR)
end

def build_platform(os, arch)
  destdir = File.join(RELEASE_DIR, os, arch)
  FileUtils.mkdir_p(destdir)
  run!(%W[make GOOS=#{os} GOARCH=#{arch} DESTDIR=#{destdir}])
end

main