2 Star 0 Fork 0

mirrors_vmware-archive/api-explorer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
set-version.sh 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
# This script is a post build step that fixes up the information in the ./dist/version.json
# to reflect the variables of this particular build
BRANCH_DIR="$( cd "$( dirname "$0" )" && pwd )"
VERSION_FILE=${BRANCH_DIR}/dist/version.json
NOW=`date +%FT%T%Z`
APIX_VERSION=`grep \"version\" ./package.json | sed 's/[\",]//g' | sed 's/[ \t]*version:[ \t]*//g'`
: "${BRANCH_NAME:=`git rev-parse --abbrev-ref HEAD`}"
: "${CHANGE_NUMBER:=`git rev-parse HEAD`}"
: "${BUILD_NUMBER:=0}"
#echo "BUILD_NUMBER=${BUILD_NUMBER}"
#echo "BRANCH_NAME=${BRANCH_NAME}"
#echo "CHANGE_NUMBER=${CHANGE_NUMBER}"
#echo "APIX_VERSION=${APIX_VERSION}"
#echo "NOW=${NOW}"
if [ -f ${VERSION_FILE} ]; then
sed -i "s/APIX_GIT_SHA/${CHANGE_NUMBER}/g" ${VERSION_FILE}
sed -i "s/APIX_GIT_BRANCH/${BRANCH_NAME}/g" ${VERSION_FILE}
sed -i "s/APIX_VERSION/${APIX_VERSION}/g" ${VERSION_FILE}
sed -i "s/APIX_BUILD_DATE/${NOW} build:${BUILD_NUMBER}/g" ${VERSION_FILE}
sed -i "s/APIX_BUILD_NUMBER/${BUILD_NUMBER}/g" ${VERSION_FILE}
else
echo "version file '${VERSION_FILE}' does not exist."
exit 1
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_vmware-archive/api-explorer.git
git@gitee.com:mirrors_vmware-archive/api-explorer.git
mirrors_vmware-archive
api-explorer
api-explorer
master

搜索帮助