# No shebang line as this script is sourced from an external shell. # Copyright 2019 The Vitess Authors. # # 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. source ./tools/shell_functions.inc 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." goversion_min 1.13 || fail "Go version reported: ${go version}. Version 1.13+ required. See https://vitess.io/contributing/build-from-source for install instructions." 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