From 43ea21c3bb1b6b9b5e50038278e7bebbe5d0f096 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Aug 2019 14:54:00 +0300 Subject: [PATCH 01/14] Initial GitHub CI/CD GitHub CI/CD is [a thing](https://github.com/features/actions)! We will attempt: - CI: build + unit test - replica tests: running `gh-ost` tests on multiple MySQL versions --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ec8978d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +name: CI + +on: [pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: Set up Go 1.12 + uses: actions/setup-go@v1 + with: + version: 1.12 + id: go + + - name: Build + run: script/cibuild From 6cfa76d1399238fb6350125e1b20613247cb50c2 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Aug 2019 14:58:37 +0300 Subject: [PATCH 02/14] adding replica-tests --- .github/workflows/replica-tests.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/replica-tests.yml diff --git a/.github/workflows/replica-tests.yml b/.github/workflows/replica-tests.yml new file mode 100644 index 0000000..5fbff05 --- /dev/null +++ b/.github/workflows/replica-tests.yml @@ -0,0 +1,20 @@ +name: CI + +on: [pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: Set up Go 1.12 + uses: actions/setup-go@v1 + with: + version: 1.12 + id: go + + - name: Build + run: script/cibuild-gh-ost-replica-tests From 18612b661ac30e3ff45237ba104af251308a0a8f Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Aug 2019 14:59:22 +0300 Subject: [PATCH 03/14] name of test --- .github/workflows/replica-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/replica-tests.yml b/.github/workflows/replica-tests.yml index 5fbff05..ac2535b 100644 --- a/.github/workflows/replica-tests.yml +++ b/.github/workflows/replica-tests.yml @@ -1,4 +1,4 @@ -name: CI +name: Replica tests on: [pull_request] From e618682ff9355093c6b7ce7625aec3057e352891 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Aug 2019 15:04:04 +0300 Subject: [PATCH 04/14] go1.12 --- .github/workflows/replica-tests.yml | 4 ++-- script/ensure-go-installed | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/replica-tests.yml b/.github/workflows/replica-tests.yml index ac2535b..d775131 100644 --- a/.github/workflows/replica-tests.yml +++ b/.github/workflows/replica-tests.yml @@ -1,4 +1,4 @@ -name: Replica tests +name: migration tests on: [pull_request] @@ -16,5 +16,5 @@ jobs: version: 1.12 id: go - - name: Build + - name: migration tests run: script/cibuild-gh-ost-replica-tests diff --git a/script/ensure-go-installed b/script/ensure-go-installed index a511e0e..c9c2ae8 100755 --- a/script/ensure-go-installed +++ b/script/ensure-go-installed @@ -1,20 +1,20 @@ #!/bin/bash -PREFERRED_GO_VERSION=go1.9.2 -SUPPORTED_GO_VERSIONS='go1.[89]' +PREFERRED_GO_VERSION=go1.12.6 +SUPPORTED_GO_VERSIONS='go1.1[234]' GO_PKG_DARWIN=${PREFERRED_GO_VERSION}.darwin-amd64.pkg -GO_PKG_DARWIN_SHA=8b4f6ae6deae1150d2e341d02c247fd18a99af387516540eeb84702ffd76d3a1 +GO_PKG_DARWIN_SHA=ea78245e43de2996fa0973033064b33f48820cfe39f4f3c6e953040925cc5815 GO_PKG_LINUX=${PREFERRED_GO_VERSION}.linux-amd64.tar.gz -GO_PKG_LINUX_SHA=de874549d9a8d8d8062be05808509c09a88a248e77ec14eb77453530829ac02b +GO_PKG_LINUX_SHA=dbcf71a3c1ea53b8d54ef1b48c85a39a6c9a935d01fc8291ff2b92028e59913c export ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" cd $ROOTDIR # If Go isn't installed globally, setup environment variables for local install. if [ -z "$(which go)" ] || [ -z "$(go version | grep "$SUPPORTED_GO_VERSIONS")" ]; then - GODIR="$ROOTDIR/.vendor/go19" + GODIR="$ROOTDIR/.vendor/golocal" if [ $(uname -s) = "Darwin" ]; then export GOROOT="$GODIR/usr/local/go" @@ -32,12 +32,12 @@ if [ -z "$(which go)" ] || [ -z "$(go version | grep "$SUPPORTED_GO_VERSIONS")" cd "$GODIR"; if [ $(uname -s) = "Darwin" ]; then - curl -L -O https://storage.googleapis.com/golang/$GO_PKG_DARWIN + curl -L -O https://dl.google.com/go/$GO_PKG_DARWIN shasum -a256 $GO_PKG_DARWIN | grep $GO_PKG_DARWIN_SHA xar -xf $GO_PKG_DARWIN cpio -i < com.googlecode.go.pkg/Payload else - curl -L -O https://storage.googleapis.com/golang/$GO_PKG_LINUX + curl -L -O https://dl.google.com/go/$GO_PKG_LINUX shasum -a256 $GO_PKG_LINUX | grep $GO_PKG_LINUX_SHA tar xf $GO_PKG_LINUX fi From b881bff1e8f3801ed00a727bb9bafe42c7299c46 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Aug 2019 15:06:03 +0300 Subject: [PATCH 05/14] fixed linter issue --- go/logic/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/logic/server.go b/go/logic/server.go index 774c4ab..4c1f581 100644 --- a/go/logic/server.go +++ b/go/logic/server.go @@ -144,7 +144,7 @@ func (this *Server) applyServerCommand(command string, writer *bufio.Writer) (pr switch command { case "help": { - fmt.Fprintln(writer, `available commands: + fmt.Fprint(writer, `available commands: status # Print a detailed status message sup # Print a short status message coordinates # Print the currently inspected coordinates From 106ca5df3caa3a9c972dbc69cf966eb583e72406 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Aug 2019 15:12:14 +0300 Subject: [PATCH 06/14] debug info --- script/cibuild-gh-ost-replica-tests | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index ab8c689..c312aa9 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -44,9 +44,11 @@ test_mysql_version() { sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master echo 'sandboxes/rsandbox/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master + cat gh-ost-ci-env/bin/gh-ost-test-mysql-master sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-replica echo 'sandboxes/rsandbox/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica + cat gh-ost-ci-env/bin/gh-ost-test-mysql-replica export PATH="${PWD}/gh-ost-ci-env/bin/:${PATH}" From 1305ff6e010e40631fb887c3e317acedb7c09af5 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Aug 2019 15:17:48 +0300 Subject: [PATCH 07/14] debug info --- localtests/test.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/localtests/test.sh b/localtests/test.sh index 1078965..0a913ae 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -50,6 +50,22 @@ verify_master_and_replica() { original_sql_mode="$(gh-ost-test-mysql-master -e "select @@global.sql_mode" -s -s)" echo "sql_mode on master is ${original_sql_mode}" + gh-ost-test-mysql-replica -uroot -proot -e "select 1 as root" -ss + gh-ost-test-mysql-replica -e "select 1 as msandbox" -ss + sleep 1 + gh-ost-test-mysql-replica -uroot -proot -e "select 1 as root" -ss + gh-ost-test-mysql-replica -e "select 1 as msandbox" -ss + sleep 1 + gh-ost-test-mysql-replica -uroot -proot -e "select 1 as root" -ss + gh-ost-test-mysql-replica -e "select 1 as msandbox" -ss + sleep 1 + gh-ost-test-mysql-replica -uroot -proot -e "select 1 as root" -ss + gh-ost-test-mysql-replica -e "select 1 as msandbox" -ss + sleep 1 + gh-ost-test-mysql-replica -uroot -proot -e "select 1 as root" -ss + gh-ost-test-mysql-replica -e "select 1 as msandbox" -ss + sleep 1 + if [ "$(gh-ost-test-mysql-replica -e "select 1" -ss)" != "1" ] ; then echo "Cannot verify gh-ost-test-mysql-replica" exit 1 From 90ab2368dd247da73d1cc58c726fc7fc089e86ed Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Aug 2019 15:21:04 +0300 Subject: [PATCH 08/14] graceful sleep; remove extra debug info --- localtests/test.sh | 17 ++--------------- script/cibuild-gh-ost-replica-tests | 2 -- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/localtests/test.sh b/localtests/test.sh index 0a913ae..d4b3f17 100755 --- a/localtests/test.sh +++ b/localtests/test.sh @@ -50,21 +50,8 @@ verify_master_and_replica() { original_sql_mode="$(gh-ost-test-mysql-master -e "select @@global.sql_mode" -s -s)" echo "sql_mode on master is ${original_sql_mode}" - gh-ost-test-mysql-replica -uroot -proot -e "select 1 as root" -ss - gh-ost-test-mysql-replica -e "select 1 as msandbox" -ss - sleep 1 - gh-ost-test-mysql-replica -uroot -proot -e "select 1 as root" -ss - gh-ost-test-mysql-replica -e "select 1 as msandbox" -ss - sleep 1 - gh-ost-test-mysql-replica -uroot -proot -e "select 1 as root" -ss - gh-ost-test-mysql-replica -e "select 1 as msandbox" -ss - sleep 1 - gh-ost-test-mysql-replica -uroot -proot -e "select 1 as root" -ss - gh-ost-test-mysql-replica -e "select 1 as msandbox" -ss - sleep 1 - gh-ost-test-mysql-replica -uroot -proot -e "select 1 as root" -ss - gh-ost-test-mysql-replica -e "select 1 as msandbox" -ss - sleep 1 + echo "Gracefully sleeping for 3 seconds while replica is setting up..." + sleep 3 if [ "$(gh-ost-test-mysql-replica -e "select 1" -ss)" != "1" ] ; then echo "Cannot verify gh-ost-test-mysql-replica" diff --git a/script/cibuild-gh-ost-replica-tests b/script/cibuild-gh-ost-replica-tests index c312aa9..ab8c689 100755 --- a/script/cibuild-gh-ost-replica-tests +++ b/script/cibuild-gh-ost-replica-tests @@ -44,11 +44,9 @@ test_mysql_version() { sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master echo 'sandboxes/rsandbox/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master - cat gh-ost-ci-env/bin/gh-ost-test-mysql-master sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-replica echo 'sandboxes/rsandbox/s1 "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-replica - cat gh-ost-ci-env/bin/gh-ost-test-mysql-replica export PATH="${PWD}/gh-ost-ci-env/bin/:${PATH}" From 17e4fe80175c1d00b2665017d07a3571619814d5 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Aug 2019 15:26:29 +0300 Subject: [PATCH 09/14] TravisCI updated to go1.12 ; but we are likely to remove TravisCI anyhow --- .travis.yml | 3 +-- README.md | 2 +- build.sh | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index b6b68f3..1944f00 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,7 @@ language: go go: - - "1.9" - - "1.10" + - "1.12.x" os: - linux diff --git a/README.md b/README.md index 008c65b..cd6f592 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ Please see [Coding gh-ost](doc/coding-ghost.md) for a guide to getting started d [Download latest release here](https://github.com/github/gh-ost/releases/latest) -`gh-ost` is a Go project; it is built with Go `1.9` and above. To build on your own, use either: +`gh-ost` is a Go project; it is built with Go `1.12` and above. To build on your own, use either: - [script/build](https://github.com/github/gh-ost/blob/master/script/build) - this is the same build script used by CI hence the authoritative; artifact is `./bin/gh-ost` binary. - [build.sh](https://github.com/github/gh-ost/blob/master/build.sh) for building `tar.gz` artifacts in `/tmp/gh-ost` diff --git a/build.sh b/build.sh index df9ac7d..8b6925d 100755 --- a/build.sh +++ b/build.sh @@ -20,9 +20,9 @@ function build { - if ! go version | egrep -q 'go(1[.]9|1[.]1[0-9])' ; then - echo "go version is too low. Must use 1.9 or above" - exit 1 + if ! go version | egrep -q 'go(1\.1[234])' ; then + echo "go version must be 1.12 or above" + ok=1 fi echo "Building ${osname} binary" From e1c8df744788721ef7b1def8c75b4981f686f0bf Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Sun, 11 Aug 2019 15:29:28 +0300 Subject: [PATCH 10/14] travis: declaring mysql service --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1944f00..c1c1891 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,9 @@ go: os: - linux +services: + - mysql + env: - MYSQL_USER=root - CURRENT_CI_ENV=travis From 143abf05b0f85080cc1e27a6c5f2ed5f1538cef3 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 12 Aug 2019 08:03:17 +0300 Subject: [PATCH 11/14] fail when go is < 1.12 --- build.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 8b6925d..b7f3a54 100755 --- a/build.sh +++ b/build.sh @@ -18,11 +18,9 @@ function build { GOOS=$3 GOARCH=$4 - - if ! go version | egrep -q 'go(1\.1[234])' ; then echo "go version must be 1.12 or above" - ok=1 + exit 1 fi echo "Building ${osname} binary" From 3362c5d32254bd78e0bfcf305c77cff46e62983c Mon Sep 17 00:00:00 2001 From: Gillian Gunson Date: Mon, 12 Aug 2019 12:40:31 -0700 Subject: [PATCH 12/14] Changing panic message --- go/logic/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/logic/server.go b/go/logic/server.go index 774c4ab..e1919ab 100644 --- a/go/logic/server.go +++ b/go/logic/server.go @@ -341,7 +341,7 @@ help # This message err := fmt.Errorf("User commanded 'panic' on %s, but migrated table is %s; ignoring request.", arg, this.migrationContext.OriginalTableName) return NoPrintStatusRule, err } - err := fmt.Errorf("User commanded 'panic'. I will now panic, without cleanup. PANIC!") + err := fmt.Errorf("User commanded 'panic'. The migration will be aborted without cleanup. Please drop the gh-ost tables before trying again.") this.migrationContext.PanicAbort <- err return NoPrintStatusRule, err } From 6cc1a1a34e27a301fb755ff21646acc9f3f7cdf0 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Thu, 15 Aug 2019 11:10:48 +0300 Subject: [PATCH 13/14] CI: adapting to internal builds system --- Dockerfile.test | 11 ++++ docker-compose.yml | 7 +++ script/bootstrap | 1 + script/build-deploy-tarball | 35 ++++++++++++ script/cibuild | 16 +----- script/cibuild-gh-ost-build-deploy-tarball | 66 +++++++++++++--------- script/test | 17 ++++++ 7 files changed, 110 insertions(+), 43 deletions(-) create mode 100644 Dockerfile.test create mode 100644 docker-compose.yml create mode 100644 script/build-deploy-tarball create mode 100644 script/test diff --git a/Dockerfile.test b/Dockerfile.test new file mode 100644 index 0000000..6abc4a0 --- /dev/null +++ b/Dockerfile.test @@ -0,0 +1,11 @@ +FROM golang:1.12.1 +LABEL maintainer="github@github.com" + +RUN apt-get update +RUN apt-get install -y lsb-release +RUN rm -rf /var/lib/apt/lists/* + +COPY . /go/src/github.com/github/gh-ost +WORKDIR /go/src/github.com/github/gh-ost + +CMD ["script/test"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..8a2bd2e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: "3.5" +services: + app: + image: app + build: + context: . + dockerfile: Dockerfile.test diff --git a/script/bootstrap b/script/bootstrap index 6ac885b..573313a 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -4,6 +4,7 @@ set -e # Make sure we have the version of Go we want to depend on, either from the # system or one we grab ourselves. +# If executing from within Dockerfile then this assumption is inherently true, since we use a `golang` docker image. . script/ensure-go-installed # Since we want to be able to build this outside of GOPATH, we set it diff --git a/script/build-deploy-tarball b/script/build-deploy-tarball new file mode 100644 index 0000000..d36b6c9 --- /dev/null +++ b/script/build-deploy-tarball @@ -0,0 +1,35 @@ +#!/bin/sh + +set -e + +script/build + +# Get a fresh directory and make sure to delete it afterwards +build_dir=tmp/build +rm -rf $build_dir +mkdir -p $build_dir +trap "rm -rf $build_dir" EXIT + +commit_sha=$(git rev-parse HEAD) + +if [ $(uname -s) = "Darwin" ]; then + build_arch="$(uname -sr | tr -d ' ' | tr '[:upper:]' '[:lower:]')-$(uname -m)" +else + build_arch="$(lsb_release -sc | tr -d ' ' | tr '[:upper:]' '[:lower:]')-$(uname -m)" +fi + +tarball=$build_dir/${commit_sha}-${build_arch}.tar + +# Create the tarball +tar cvf $tarball --mode="ugo=rx" bin/ + +# Compress it and copy it to the directory for the CI to upload it +gzip $tarball +mkdir -p "$BUILD_ARTIFACT_DIR"/gh-ost +cp ${tarball}.gz "$BUILD_ARTIFACT_DIR"/gh-ost/ + +### HACK HACK HACK ### +# blame @carlosmn and @mattr- +# Allow builds on stretch to also be used for jessie +jessie_tarball_name=$(echo $(basename "${tarball}") | sed s/-stretch-/-jessie-/) +cp ${tarball}.gz "$BUILD_ARTIFACT_DIR/gh-ost/${jessie_tarball_name}.gz" diff --git a/script/cibuild b/script/cibuild index 7e757b5..e609b7a 100755 --- a/script/cibuild +++ b/script/cibuild @@ -1,17 +1,3 @@ #!/bin/bash -set -e - -. script/bootstrap - -echo "Verifying code is formatted via 'gofmt -s -w go/'" -gofmt -s -w go/ -git diff --exit-code --quiet - -echo "Building" -script/build - -cd .gopath/src/github.com/github/gh-ost - -echo "Running unit tests" -go test ./go/... +script/test diff --git a/script/cibuild-gh-ost-build-deploy-tarball b/script/cibuild-gh-ost-build-deploy-tarball index 692b42b..a852ad6 100755 --- a/script/cibuild-gh-ost-build-deploy-tarball +++ b/script/cibuild-gh-ost-build-deploy-tarball @@ -1,37 +1,47 @@ -#!/bin/sh +#!/bin/bash -set -e +output_fold() { + # Exit early if no label provided + if [ -z "$1" ]; then + echo "output_fold(): requires a label argument." + return + fi -script/cibuild + exit_value=0 # exit_value is used to record exit status of the given command + label=$1 # human-readable label describing what's being folded up + shift 1 # having retrieved the output_fold()-specific arguments, strip them off $@ -# Get a fresh directory and make sure to delete it afterwards -build_dir=tmp/build -rm -rf $build_dir -mkdir -p $build_dir -trap "rm -rf $build_dir" EXIT + # Only echo the tags when in CI_MODE + if [ "$CI_MODE" ]; then + echo "%%%FOLD {$label}%%%" + fi -commit_sha=$(git rev-parse HEAD) + # run the remaining arguments. If the command exits non-0, the `||` will + # prevent the `-e` flag from seeing the failure exit code, and we'll see + # the second echo execute + "$@" || exit_value=$? -if [ $(uname -s) = "Darwin" ]; then - build_arch="$(uname -sr | tr -d ' ' | tr '[:upper:]' '[:lower:]')-$(uname -m)" -else - build_arch="$(lsb_release -sc | tr -d ' ' | tr '[:upper:]' '[:lower:]')-$(uname -m)" -fi + # Only echo the tags when in CI_MODE + if [ "$CI_MODE" ]; then + echo "%%%END FOLD%%%" + fi -tarball=$build_dir/${commit_sha}-${build_arch}.tar + # preserve the exit code from the subcommand. + return $exit_value +} -# Create the tarball -tar cvf $tarball --mode="ugo=rx" bin/ +function cleanup() { + echo + echo "%%%FOLD {Shutting down services...}%%%" + docker-compose down + echo "%%%END FOLD%%%" +} -# Compress it and copy it to the directory for the CI to upload it -gzip $tarball -mkdir -p "$BUILD_ARTIFACT_DIR"/gh-ost -cp ${tarball}.gz "$BUILD_ARTIFACT_DIR"/gh-ost/ +trap cleanup EXIT -### HACK HACK HACK ### -# Blame @carlosmn. In the good way. -# We don't have any jessie machines for building, but a pure-Go binary depends -# on a version of libc and ld which are widely available, so we can copy the -# tarball over with jessie in its name so we can deploy it on jessie machines. -jessie_tarball_name=$(echo $(basename "${tarball}") | sed s/-precise-/-jessie-/) -cp ${tarball}.gz "$BUILD_ARTIFACT_DIR/gh-ost/${jessie_tarball_name}.gz" +export CI_MODE=true + +output_fold "Bootstrapping container..." docker-compose build +output_fold "Running tests..." docker-compose run --rm app + +docker-compose run -e BUILD_ARTIFACT_DIR=$BUILD_ARTIFACT_DIR -v $BUILD_ARTIFACT_DIR:$BUILD_ARTIFACT_DIR app script/build-deploy-tarball diff --git a/script/test b/script/test new file mode 100644 index 0000000..7e757b5 --- /dev/null +++ b/script/test @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e + +. script/bootstrap + +echo "Verifying code is formatted via 'gofmt -s -w go/'" +gofmt -s -w go/ +git diff --exit-code --quiet + +echo "Building" +script/build + +cd .gopath/src/github.com/github/gh-ost + +echo "Running unit tests" +go test ./go/... From 36b0adb1b8a06aa490f00518348e5c4dcf37ce42 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Thu, 15 Aug 2019 11:14:10 +0300 Subject: [PATCH 14/14] executable scripts --- script/build-deploy-tarball | 0 script/test | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 script/build-deploy-tarball mode change 100644 => 100755 script/test diff --git a/script/build-deploy-tarball b/script/build-deploy-tarball old mode 100644 new mode 100755 diff --git a/script/test b/script/test old mode 100644 new mode 100755