4 Star 21 Fork 10

Gitee 极速下载/RedisShake

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/alibaba/RedisShake
克隆/下载
build.sh 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
suxb201 提交于 2024-12-12 16:55 +08:00 . feat: add version to release asset names (#901)
#!/bin/bash
set -e
echo "[ BUILD RELEASE ]"
BIN_DIR=$(pwd)/bin/
rm -rf "$BIN_DIR"
mkdir -p "$BIN_DIR"
cp shake.toml "$BIN_DIR"
VERSION=${VERSION:-"dev"}
if git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
COMMIT=${COMMIT:-$(git rev-parse --short HEAD)}
else
COMMIT=${COMMIT:-"unknown"}
fi
LDFLAGS=${LDFLAGS:-"-X main.Version=${VERSION} -X main.GitCommit=${COMMIT}"}
dist() {
echo "try build GOOS=$1 GOARCH=$2"
export GOOS=$1
export GOARCH=$2
export CGO_ENABLED=0
go build -v -trimpath -ldflags "${LDFLAGS}" -o "$BIN_DIR/redis-shake" "./cmd/redis-shake"
unset GOOS
unset GOARCH
echo "build success GOOS=$1 GOARCH=$2"
cd "$BIN_DIR"
tar -czvf ./redis-shake-"$1"-"$2".tar.gz ./redis-shake ./shake.toml
cd ..
}
if [ "$1" == "dist" ]; then
echo "[ DIST ]"
for g in "linux" "darwin" "windows"; do
for a in "amd64" "arm64"; do
dist "$g" "$a"
done
done
fi
# build the current platform
echo "try build for current platform"
go build -v -trimpath -ldflags "${LDFLAGS}" -o "$BIN_DIR/redis-shake" "./cmd/redis-shake"
echo "build success"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/RedisShake.git
git@gitee.com:mirrors/RedisShake.git
mirrors
RedisShake
RedisShake
v4

搜索帮助