代码拉取完成,页面将自动刷新
#!/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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。