Test logging
This commit is contained in:
parent
fdc1a4f8bf
commit
bf4563b1ae
|
@ -136,20 +136,24 @@ function reconfigure_gogs {
|
|||
}
|
||||
|
||||
function upgrade_gogs {
|
||||
echo "1" > ~/build/testlog.txt
|
||||
if ! grep 'gogs version:' $COMPLETION_FILE; then
|
||||
return
|
||||
fi
|
||||
|
||||
echo "2" > ~/build/testlog.txt
|
||||
CURR_GOGS_VERSION=$(get_completion_param "gogs version")
|
||||
echo "gogs current version: ${CURR_GOGS_VERSION}"
|
||||
echo "gogs app version: ${GOGS_VERSION}"
|
||||
if [[ "${CURR_GOGS_VERSION}" == "${GOGS_VERSION}" ]]; then
|
||||
return
|
||||
fi
|
||||
echo "3" > ~/build/testlog.txt
|
||||
|
||||
gogs_parameters
|
||||
echo "gogs binary upgrade: ${GOGS_BIN}"
|
||||
|
||||
echo "4" > ~/build/testlog.txt
|
||||
if [ ! -d ${INSTALL_DIR} ]; then
|
||||
mkdir -p ${INSTALL_DIR}
|
||||
fi
|
||||
|
@ -158,10 +162,14 @@ function upgrade_gogs {
|
|||
rm -rf ${INSTALL_DIR}/gogs
|
||||
fi
|
||||
GOGS_FILE=linux_${CURR_ARCH}.tar.gz
|
||||
echo "5" > ~/build/testlog.txt
|
||||
if [ ! -f ${GOGS_FILE} ]; then
|
||||
wget ${GOGS_BIN}
|
||||
echo "6" > ~/build/testlog.txt
|
||||
fi
|
||||
echo "7" > ~/build/testlog.txt
|
||||
if [ ! -f ${GOGS_FILE} ]; then
|
||||
echo "8" > ~/build/testlog.txt
|
||||
GOGS_FILE=linux_${CURR_ARCH}.zip
|
||||
GOGS_BIN="https://github.com/gogits/gogs/releases/download/v${GOGS_VERSION}/${GOGS_FILE}"
|
||||
if [ ! -f ${GOGS_FILE} ]; then
|
||||
|
@ -174,16 +182,20 @@ function upgrade_gogs {
|
|||
unzip -o ${GOGS_FILE}
|
||||
fi
|
||||
else
|
||||
echo "9" > ~/build/testlog.txt
|
||||
tar -xzf ${INSTALL_DIR}/${GOGS_FILE}
|
||||
fi
|
||||
echo "10" > ~/build/testlog.txt
|
||||
if [ ! -d ${INSTALL_DIR}/gogs ]; then
|
||||
exit 37823
|
||||
fi
|
||||
echo "11" > ~/build/testlog.txt
|
||||
rm -rf /home/${GOGS_USERNAME}/*
|
||||
cp -r ${INSTALL_DIR}/gogs/* /home/${GOGS_USERNAME}
|
||||
if [ -f ${GOGS_FILE} ]; then
|
||||
rm ${GOGS_FILE}
|
||||
fi
|
||||
echo "12" > ~/build/testlog.txt
|
||||
|
||||
sed -i "s|gogs version.*|gogs version:$GOGS_VERSION|g" ${COMPLETION_FILE}
|
||||
systemctl restart gogs
|
||||
|
|
Loading…
Reference in New Issue