代码拉取完成,页面将自动刷新
同步操作将从 StreamxHub/opencron 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
# Name: doDeploy.sh
#Execute this shell script to deploy Java projects built by Maven automatically on remote hosts.
# debug option
DEBUG=false
#DEBUG=true
if $DEBUG ; then
old_PS4=$PS4
# export PS4='+${BASH_SOURCE}:${LINENO}:${FUNCNAME[0]}: '
export PS4='+${LINENO}: ${FUNCNAME[0]}: ' # if there is only one bash script, do not display ${BASH_SOURCE}
_XTRACE_FUNCTIONS=$(set +o | grep xtrace)
set -o xtrace
fi
PRG="$0"
while [ -h "$PRG" ]; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
# Get standard environment variables
PRGDIR=`dirname "$PRG"`
# echo color function, smarter, learn from lnmp.org lnmp install.sh
function echo_r (){
# Color red: Error, Failed
[ $# -ne 1 ] && return 1
echo -e "\033[31m$1\033[0m"
}
function echo_g (){
# Color green: Success
[ $# -ne 1 ] && return 1
echo -e "\033[32m$1\033[0m"
}
function echo_y (){
# Color yellow: Warning
[ $# -ne 1 ] && return 1
echo -e "\033[33m$1\033[0m"
}
function echo_b (){
# Color blue: Debug Level 1
[ $# -ne 1 ] && return 1
echo -e "\033[34m$1\033[0m"
}
function echo_p (){
# Color purple,magenta: Debug Level 2
[ $# -ne 1 ] && return 1
echo -e "\033[35m$1\033[0m"
}
function echo_c (){
# Color cyan: friendly prompt, Level 1
[ $# -ne 1 ] && return 1
echo -e "\033[36m$1\033[0m"
}
# end echo color function, smarter
#WORKDIR="`realpath ${WORKDIR}`"
WORKDIR="`readlink -f ${PRGDIR}`"
# end public header
# =============================================================================================================================
USER="`id -un`"
LOGNAME="$USER"
if [ $UID -ne 0 ]; then
echo "WARNING: Running as a non-root user, \"$LOGNAME\". Functionality may be unavailable. Only root can use some commands or options"
fi
function build(){
echo_b "Do mvn build java project for `echo $1 | awk -F '[/.]+' '{ print $(NF-1)}'`... "
mvn install >>${WORKDIR}/mvn_build_$(date +%Y%m%d)_$$.log 2>&1
retval=$?
if [ ${retval} -ne 0 ] ; then
echo_r "mvn install failed! More details refer to ${WORKDIR}/mvn_build_$(date +%Y%m%d)_$$.log"
exit 1
else
echo_g "mvn install for ${project_clone_repository_name} successfully! "
fi
mvn clean package >>${WORKDIR}/mvn_build_$(date +%Y%m%d)_$$.log 2>&1
retval=$?
if [ ${retval} -ne 0 ] ; then
echo_r "mvn clean package for ${project_clone_repository_name} failed! More details refer to ${WORKDIR}/mvn_build_$(date +%Y%m%d)_$$.log"
exit 1
else
echo_g "mvn clean package for ${project_clone_repository_name} successfully! "
fi
cd ${WORKDIR}
echo_g "Do mvn build java project finished for ${project_clone_repository_name} with exit code 0! "
echo
}
# debug option
if $DEBUG ; then
export PS4=$old_PS4
${_XTRACE_FUNCTIONS}
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。