From 06165fa0afa843ada266b2f453eb723c8174b5bd Mon Sep 17 00:00:00 2001 From: "Jacob Vosmaer (GitLab)" Date: Thu, 3 Aug 2017 10:15:08 +0000 Subject: Remove test gitaly when older than version file --- scripts/gitaly-test-build | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'scripts/gitaly-test-build') diff --git a/scripts/gitaly-test-build b/scripts/gitaly-test-build index 44d314009e2..95d9fe0f176 100755 --- a/scripts/gitaly-test-build +++ b/scripts/gitaly-test-build @@ -1,5 +1,7 @@ #!/usr/bin/env ruby +require 'fileutils' + # This script assumes tmp/tests/gitaly already contains the correct # Gitaly version. We just have to compile it and run its 'bundle # install'. We have this separate script for that because weird things @@ -7,4 +9,11 @@ # called 'bundle install' using a different Gemfile, as happens with # gitlab-ce and gitaly. -abort 'gitaly build failed' unless system('make', chdir: 'tmp/tests/gitaly') +dir = 'tmp/tests/gitaly' + +abort 'gitaly build failed' unless system('make', chdir: dir) + +# 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(dir, 'gitaly'), mtime: Time.now + (1 << 24)) -- cgit v1.2.1