redis-shake工具
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.3 KiB

6 years ago
#!/bin/bash
6 years ago
set -o errexit
# make sure we're in the directory where the project lives
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$PROJECT_DIR"
MODULE_NAME=$(grep module src/go.mod |cut -d ' ' -f 2)
# go version >=1.6
go_version=$(go version | awk -F' ' '{print $3;}')
bigVersion=$(echo $go_version | awk -F'[o.]' '{print $2}')
midVersion=$(echo $go_version | awk -F'[o.]' '{print $3}')
if [ $bigVersion -lt "1" -o $bigVersion -eq "1" -a $midVersion -lt "6" ]; then
echo "go version[$go_version] must >= 1.6"
exit 1
fi
6 years ago
# older version Git don't support --short !
if [ -d ".git" ];then
branch=$(git symbolic-ref -q HEAD | awk -F'/' '{print $3;}')
cid=$(git rev-parse HEAD)
else
branch="unknown"
cid="0.0"
fi
branch=$branch","$cid
info="$MODULE_NAME/redis-shake/common.Version=$branch"
6 years ago
# golang version
info=$info","$go_version
6 years ago
t=$(date "+%Y-%m-%d_%H:%M:%S")
info=$info","$t
echo "[ BUILD RELEASE ]"
BIN_DIR=$(pwd)/bin/
cd src
goos=(linux darwin windows)
for g in "linux" "darwin" "windows";
do
echo "try build GOOS=$g"
export GOOS=$g
go build -v -trimpath -ldflags "-X $info" -o "$BIN_DIR/redis-shake.$g" "$MODULE_NAME/redis-shake/main"
unset GOOS
echo "build $g successfully!"
done
Feature 2.0 (#276) * add CI * in debug CI * in debug CI * in debug CI * in debugging CI * in debug CI * in debugging CI * in debug CI 2 * split sync code from sync.go to dbSync directory to make code clean * finish adjust sync mode code * update a lit * add cluster node list judge, only accpet role master. see #149 * update ChangeLog * update ChangeLOG 2 * add CI * in debug CI * in debug CI * in debug CI * in debugging CI * in debug CI * in debugging CI * in debug CI 2 * split sync code from sync.go to dbSync directory to make code clean * finish adjust sync mode code * update a lit * add cluster node list judge, only accpet role master. see #149 * update ChangeLog * update ChangeLOG 2 * merge commit in feature-1.6 manually. see pull/201 * resuming from break-point, in coding * add resume_from_break_point in configuration * resuming from break-point, in coding 2 * resuming from break-point, finish offset adjust * merge v1.6.24 manully * update some metrics * update, add run-id * almost finish resume from break-point * polish resume from breakpoint * release 1.7-unstable v1 * modify ChangeLog * restore add parameters judge when version >= 5.0 * cherry pick 3ea30b05365d679a02248150b4c9987f0c65e98c * update redis-go-cluster to add more log details * cherry pick 0e10b0defa7726bd02b5b10620ef79618a547cb3 * bugfix of sendId, see #222 * improve: rename used -> available in delayChan. see #233 * block password, see #229 * set auth_type to 'auth' as default, see #237 * release v1.6.26 * modify ChangeLog * polish conf comment * merge 16.27 manually * 1. polish conf 2. add filter key for redis-shake-checkpoint * 1. polish conf 2. add filter key for redis-shake-checkpoint2 * unify offset by only one, step 1: modify checkpoint and add ut * unify offset by only one, step 2: modify syncIncrease.go. haven't test yet * unify offset by only one, step 3: finish test * finish cluster resuming from break point and pass simple test * update driver * add picture of resuming from break point * add picture of resuming from break point * add checkpoint and conf version * cherry pick 1d6c8ed83f35ae41c7f49d21a3b8d2f5d04ff166 from v1.6.28 * modify the checkpoint fcv * release v2.0 * merge v1.6.28 * update redis-go-cluster to remove SELECT judge, see #273 * disable target.db when enable resume_from_break_point * release v2.0.1
5 years ago
cd $PROJECT_DIR
cp conf/redis-shake.conf $BIN_DIR