|
4 | 4 |
|
5 | 5 | whoami |
6 | 6 |
|
7 | | -# Clone gh-ost-ci-env |
8 | | -# Only clone if not already running locally at latest commit |
9 | | -remote_commit=$(git ls-remote https://github.com/github/gh-ost-ci-env.git tar-xz-binaries | cut -f1) |
10 | | -local_commit="unknown" |
11 | | -[ -d "gh-ost-ci-env" ] && local_commit=$(cd gh-ost-ci-env && git log --format="%H" -n 1) |
12 | | - |
13 | | -echo "remote commit is: $remote_commit" |
14 | | -echo "local commit is: $local_commit" |
15 | | - |
16 | | -if [ "$remote_commit" != "$local_commit" ] ; then |
17 | | - rm -rf ./gh-ost-ci-env |
18 | | - git clone https://github.com/github/gh-ost-ci-env.git |
19 | | - ( |
20 | | - cd gh-ost-ci-env |
21 | | - git fetch origin tar-xz-binaries |
22 | | - git checkout tar-xz-binaries |
23 | | - ) |
24 | | -fi |
| 7 | +fetch_ci_env() { |
| 8 | + # Clone gh-ost-ci-env |
| 9 | + # Only clone if not already running locally at latest commit |
| 10 | + remote_commit=$(git ls-remote https://github.com/github/gh-ost-ci-env.git tar-xz-binaries | cut -f1) |
| 11 | + local_commit="unknown" |
| 12 | + [ -d "gh-ost-ci-env" ] && local_commit=$(cd gh-ost-ci-env && git log --format="%H" -n 1) |
| 13 | + |
| 14 | + echo "remote commit is: $remote_commit" |
| 15 | + echo "local commit is: $local_commit" |
| 16 | + |
| 17 | + if [ "$remote_commit" != "$local_commit" ] ; then |
| 18 | + rm -rf ./gh-ost-ci-env |
| 19 | + git clone https://github.com/github/gh-ost-ci-env.git |
| 20 | + ( |
| 21 | + cd gh-ost-ci-env |
| 22 | + git fetch origin tar-xz-binaries |
| 23 | + git checkout tar-xz-binaries |
| 24 | + ) |
| 25 | + fi |
| 26 | +} |
| 27 | + |
| 28 | +test_dbdeployer() { |
| 29 | + gh-ost-ci-env/bin/linux/dbdeployer --version |
| 30 | +} |
25 | 31 |
|
26 | 32 | test_mysql_version() { |
27 | 33 | local mysql_version |
@@ -64,12 +70,19 @@ test_mysql_version() { |
64 | 70 | find sandboxes -name "stop_all" | bash |
65 | 71 | } |
66 | 72 |
|
67 | | -echo "Building..." |
68 | | -. script/build |
69 | | -# Test all versions: |
70 | | -find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.xz" | while read f ; do basename $f ".tar.xz" ; done | sort -r | while read mysql_version ; do |
71 | | - echo "found MySQL version: $mysql_version" |
72 | | -done |
73 | | -find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.xz" | while read f ; do basename $f ".tar.xz" ; done | sort -r | while read mysql_version ; do |
74 | | - test_mysql_version "$mysql_version" |
75 | | -done |
| 73 | +main() { |
| 74 | + fetch_ci_env |
| 75 | + test_dbdeployer |
| 76 | + |
| 77 | + echo "Building..." |
| 78 | + . script/build |
| 79 | + # Test all versions: |
| 80 | + find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.xz" | while read f ; do basename $f ".tar.xz" ; done | sort -r | while read mysql_version ; do |
| 81 | + echo "found MySQL version: $mysql_version" |
| 82 | + done |
| 83 | + find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.xz" | while read f ; do basename $f ".tar.xz" ; done | sort -r | while read mysql_version ; do |
| 84 | + test_mysql_version "$mysql_version" |
| 85 | + done |
| 86 | +} |
| 87 | + |
| 88 | +main() |
0 commit comments