From 813f99fd9142ee13252e69874254fb62dfc8822f Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Tue, 27 Feb 2018 13:38:19 +0200 Subject: [PATCH] clong gh-ost-ci-env only if not same commit --- script/cibuild-gh-ost-replica-tests | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index 1193b82..3cf43f6 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -4,8 +4,14 @@ set -e whoami -rm -rf ./gh-ost-ci-env -[ -d "gh-ost-ci-env" ] || git clone https://github.com/github/gh-ost-ci-env.git +# Clone gh-ost-ci-env +# Only clone if not already running locally at latest commit +remote_commit=$(git ls-remote https://github.com/github/gh-ost-ci-env.git HEAD | cut -f1) +local_commit=$(cd gh-ost-ci-env && git log --format="%H" -n 1) +if [ "$remote_commit" != "$local_commit" ] ; then + rm -rf ./gh-ost-ci-env + git clone https://github.com/github/gh-ost-ci-env.git +fi test_mysql_version() { local mysql_version