2017-07-31 09:17:14 -04:00
|
|
|
#!/usr/bin/env ruby
|
2021-02-12 07:09:02 -05:00
|
|
|
# frozen_string_literal: true
|
2017-07-31 09:17:14 -04:00
|
|
|
|
2017-08-03 06:15:08 -04:00
|
|
|
require 'fileutils'
|
|
|
|
|
2021-04-21 05:09:15 -04:00
|
|
|
require_relative '../spec/support/helpers/gitaly_setup'
|
2018-05-14 04:10:29 -04:00
|
|
|
|
2017-07-31 09:17:14 -04:00
|
|
|
# This script assumes tmp/tests/gitaly already contains the correct
|
|
|
|
# Gitaly version. We just have to compile it and run its 'bundle
|
2018-05-14 04:10:29 -04:00
|
|
|
# install'. We have this separate script for that to avoid bundle
|
|
|
|
# poisoning in CI. This script should only be run in CI.
|
|
|
|
class GitalyTestBuild
|
2021-04-21 05:09:15 -04:00
|
|
|
include GitalySetup
|
2017-07-31 09:17:14 -04:00
|
|
|
|
2018-05-14 04:10:29 -04:00
|
|
|
def run
|
2021-04-01 08:08:56 -04:00
|
|
|
set_bundler_config
|
|
|
|
|
2021-01-06 07:10:58 -05:00
|
|
|
abort 'gitaly build failed' unless build_gitaly
|
2017-08-03 06:15:08 -04:00
|
|
|
|
2020-06-02 05:08:01 -04:00
|
|
|
ensure_gitlab_shell_secret!
|
2018-05-14 04:10:29 -04:00
|
|
|
check_gitaly_config!
|
2018-01-22 05:13:33 -05:00
|
|
|
|
2018-05-14 04:10:29 -04:00
|
|
|
# Starting gitaly further validates its configuration
|
2020-03-25 14:08:10 -04:00
|
|
|
gitaly_pid = start_gitaly
|
2020-12-16 22:10:36 -05:00
|
|
|
gitaly2_pid = start_gitaly2
|
2020-03-25 14:08:10 -04:00
|
|
|
praefect_pid = start_praefect
|
|
|
|
Process.kill('TERM', gitaly_pid)
|
2020-12-16 22:10:36 -05:00
|
|
|
Process.kill('TERM', gitaly2_pid)
|
2020-03-25 14:08:10 -04:00
|
|
|
Process.kill('TERM', praefect_pid)
|
2018-01-22 05:13:33 -05:00
|
|
|
|
2018-05-14 04:10:29 -04:00
|
|
|
# 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.
|
2021-04-29 11:10:07 -04:00
|
|
|
FileUtils.touch(File.join(tmp_tests_gitaly_bin_dir, 'gitaly'), mtime: Time.now + (1 << 24))
|
|
|
|
FileUtils.touch(File.join(tmp_tests_gitaly_bin_dir, 'praefect'), mtime: Time.now + (1 << 24))
|
2018-05-14 04:10:29 -04:00
|
|
|
end
|
|
|
|
end
|
2017-08-03 06:15:08 -04:00
|
|
|
|
2018-05-14 04:10:29 -04:00
|
|
|
GitalyTestBuild.new.run
|