2 Star 3 Fork 3

好未来技术团队/alarm-dog-fe

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
updateversion.sh 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
ethananony 提交于 2020-10-28 22:08 . init
#!/bin/sh
if [ -n "$DOG_FE_VERSION" ]; then
# read from env
tag=$DOG_FE_VERSION
else
if [ "$DOG_FE_VERSION_TYPE" == "hash" ]; then
git rev-parse --short HEAD > /dev/null 2>&1
if [ $? -eq 0 ]; then
# for publish
tag=`git rev-parse --short HEAD`
elif [ -n "$image" ]; then
# for k8s
tag=`echo -n $image | awk -F ':' '{print $NF}'`
else
# error
tag='unknown'
fi
else
git rev-list --tags --max-count=1 > /dev/null 2>&1
if [ $? -eq 0 ]; then
# continue
git describe --tags $(git rev-list --tags --max-count=1) > /dev/null 2>&1
if [ $? -eq 0 ]; then
# for publish
tag=`git describe --tags $(git rev-list --tags --max-count=1)`
elif [ -n "$image" ]; then
# for k8s
tag=`echo -n $image | awk -F ':' '{print $NF}'`
else
# other
tag='unknown'
fi
else
# error
tag='unknown'
fi
fi
fi
if [ -n "$DOG_FE_VERSION_PREFIX" ]; then
tag="$DOG_FE_VERSION_PREFIX""$tag"
fi
echo "current update version tag is $tag"
if [ `uname -s` == "Darwin" ]; then
sed -i "" "s/version: '.*'/version: '$tag'/" src/settings.js
else
sed -i "s/version: '.*'/version: '$tag'/" src/settings.js
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ta-tech-team/alarm-dog-fe.git
[email protected]:ta-tech-team/alarm-dog-fe.git
ta-tech-team
alarm-dog-fe
alarm-dog-fe
master

搜索帮助