gitaly-test-build 944 字节
Newer Older
J
Jacob Vosmaer 已提交
1 2
#!/usr/bin/env ruby

3 4
require 'fileutils'

5 6
require_relative 'gitaly_test'

J
Jacob Vosmaer 已提交
7 8
# This script assumes tmp/tests/gitaly already contains the correct
# Gitaly version. We just have to compile it and run its 'bundle
9 10 11 12
# install'. We have this separate script for that to avoid bundle
# poisoning in CI. This script should only be run in CI.
class GitalyTestBuild
  include GitalyTest
J
Jacob Vosmaer 已提交
13

14 15
  def run
    abort 'gitaly build failed' unless system(env, 'make', chdir: tmp_tests_gitaly_dir)
16

17
    check_gitaly_config!
18

19 20 21
    # Starting gitaly further validates its configuration
    pid = start_gitaly
    Process.kill('TERM', pid)
22

23 24 25 26 27 28
    # Make the 'gitaly' executable look newer than 'GITALY_SERVER_VERSION'.
    # Without this a gitaly executable created in the setup-test-env job
    # will look stale compared to GITALY_SERVER_VERSION.
    FileUtils.touch(File.join(tmp_tests_gitaly_dir, 'gitaly'), mtime: Time.now + (1 << 24))
  end
end
29

30
GitalyTestBuild.new.run