Compare commits
6 Commits
master
...
dev-get-st
Author | SHA1 | Date | |
---|---|---|---|
|
759e8af34b | ||
|
d609d89f78 | ||
|
03e8d65938 | ||
|
175b6037d9 | ||
|
aa2999bd96 | ||
|
da7fdfc8b3 |
12
doc/bootstrapping-devel.md
Normal file
12
doc/bootstrapping-devel.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
## Getting started with gh-ost development.
|
||||||
|
|
||||||
|
Getting started with gh-ost development is simple!
|
||||||
|
|
||||||
|
- First clone the repository.
|
||||||
|
- From inside the repository directory, run ./script/bootstrap.
|
||||||
|
- From inside the repository directory, run ./test.sh to run the tests and validate your environment.
|
||||||
|
|
||||||
|
A couple of notes here:
|
||||||
|
|
||||||
|
- Any scripts you use for development should include `. ./scripts/env.sh` at the top. All environment variables, `$GOPATH`, `$GOROOT`, etc are set here so that all scripts can use them.
|
||||||
|
- `$GOCMD` is set to use `go 1.7` installed inside the repository. This is done so that all development is using the same version of go for easy troubleshooting.
|
@ -1,7 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Make sure we have the version of Go we want to depend on, either from the
|
# Make sure we have the version of Go we want to depend on, either from the
|
||||||
# system or one we grab ourselves.
|
# system or one we grab ourselves.
|
||||||
. script/ensure-go-installed
|
. script/ensure-go-installed
|
||||||
@ -13,4 +11,5 @@ set -x
|
|||||||
rm -rf .gopath
|
rm -rf .gopath
|
||||||
mkdir -p .gopath/src/github.com/github
|
mkdir -p .gopath/src/github.com/github
|
||||||
ln -s "$PWD" .gopath/src/github.com/github/gh-ost
|
ln -s "$PWD" .gopath/src/github.com/github/gh-ost
|
||||||
export GOPATH=$PWD/.gopath:$GOPATH
|
|
||||||
|
. ./script/env
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
. script/env
|
||||||
. script/bootstrap
|
. script/bootstrap
|
||||||
|
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
@ -13,7 +13,6 @@ scriptdir="$PWD"/script
|
|||||||
version=$(git rev-parse HEAD)
|
version=$(git rev-parse HEAD)
|
||||||
describe=$(git describe --tags --always --dirty)
|
describe=$(git describe --tags --always --dirty)
|
||||||
|
|
||||||
export GOPATH="$PWD/.gopath"
|
|
||||||
cd .gopath/src/github.com/github/gh-ost
|
cd .gopath/src/github.com/github/gh-ost
|
||||||
|
|
||||||
# We put the binaries directly into the bindir, because we have no need for shim wrappers
|
# We put the binaries directly into the bindir, because we have no need for shim wrappers
|
||||||
|
9
script/env
Executable file
9
script/env
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
## Set all environmental variables here.
|
||||||
|
|
||||||
|
export ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||||
|
export GOPATH=$ROOTDIR/.gopath
|
||||||
|
export GOPATH=$GOPATH:$ROOTDIR/vendor/:$ROOTDIR/.vendor/go17/usr/local/go/
|
||||||
|
export GOROOT=$ROOTDIR/.vendor/go17/usr/local/go/
|
||||||
|
export GOCMD=$ROOTDIR/.vendor/go17/usr/local/go/bin/go
|
4
test.sh
4
test.sh
@ -1,11 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
. ./script/env
|
||||||
|
|
||||||
retval=0
|
retval=0
|
||||||
|
|
||||||
for testsuite in base mysql sql
|
for testsuite in base mysql sql
|
||||||
do
|
do
|
||||||
pushd go/${testsuite} > /dev/null;
|
pushd go/${testsuite} > /dev/null;
|
||||||
go test $*;
|
$GOCMD test $*;
|
||||||
[ $? -ne 0 ] && retval=1
|
[ $? -ne 0 ] && retval=1
|
||||||
popd > /dev/null;
|
popd > /dev/null;
|
||||||
done
|
done
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user