2018-12-23 09:13:33 +03:00
# No shebang line as this script is sourced from an external shell.
2019-10-25 05:17:44 +03:00
# Copyright 2019 The Vitess Authors.
2018-12-23 09:13:33 +03:00
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
2019-12-07 22:11:06 +03:00
source ./tools/shell_functions.inc
2019-12-10 19:00:33 +03:00
go version >/dev/null 2>& 1 || fail "Go is not installed or is not in \$PATH. See https://vitess.io/contributing/build-from-source for install instructions."
2022-12-09 13:06:41 +03:00
goversion_min 1.18.9 || fail "Go version reported: `go version`. Version 1.18.9+ required. See https://vitess.io/contributing/build-from-source for install instructions."
2019-12-07 22:11:06 +03:00
mkdir -p dist
mkdir -p bin
mkdir -p lib
mkdir -p vthook
export VTROOT = " $PWD "
export VTDATAROOT = " ${ VTDATAROOT :- ${ VTROOT } /vtdataroot } "
export PATH = " $PWD /bin: $PATH "
mkdir -p " $VTDATAROOT "
# Set up required soft links.
# TODO(mberlin): Which of these can be deleted?
ln -snf " $PWD /go/vt/zkctl/zksrv.sh " bin/zksrv.sh
ln -snf " $PWD /test/vthook-test.sh " vthook/test.sh
ln -snf " $PWD /test/vthook-test_backup_error " vthook/test_backup_error
ln -snf " $PWD /test/vthook-test_backup_transform " vthook/test_backup_transform
# install git hooks
mkdir -p .git/hooks
ln -sf " $PWD /misc/git/pre-commit " .git/hooks/pre-commit
ln -sf " $PWD /misc/git/commit-msg " .git/hooks/commit-msg
git config core.hooksPath .git/hooks
2020-12-19 05:52:09 +03:00
export EXTRA_BIN = $PWD /test/bin