Move gogs repos back after upgrade
This commit is contained in:
parent
69e56f4443
commit
11e6257545
|
@ -162,6 +162,13 @@ function upgrade_gogs {
|
||||||
GOGS_CONFIG_FILE=$GOGS_CONFIG_PATH/app.ini
|
GOGS_CONFIG_FILE=$GOGS_CONFIG_PATH/app.ini
|
||||||
cp $GOGS_CONFIG_FILE $INSTALL_DIR/gogs_config.ini
|
cp $GOGS_CONFIG_FILE $INSTALL_DIR/gogs_config.ini
|
||||||
|
|
||||||
|
if [ -d $INSTALL_DIR/gogs-repositories ]; then
|
||||||
|
rm -rf $INSTALL_DIR/gogs-repositories
|
||||||
|
fi
|
||||||
|
if [ -d /home/${GOGS_USERNAME}/gogs-repositories ]; then
|
||||||
|
mv /home/${GOGS_USERNAME}/gogs-repositories $INSTALL_DIR
|
||||||
|
fi
|
||||||
|
|
||||||
gogs_parameters
|
gogs_parameters
|
||||||
echo "gogs binary upgrade: ${GOGS_BIN}"
|
echo "gogs binary upgrade: ${GOGS_BIN}"
|
||||||
|
|
||||||
|
@ -210,6 +217,12 @@ function upgrade_gogs {
|
||||||
exit 873535
|
exit 873535
|
||||||
fi
|
fi
|
||||||
rm $INSTALL_DIR/gogs_config.ini
|
rm $INSTALL_DIR/gogs_config.ini
|
||||||
|
if [ -d /home/${GOGS_USERNAME}/gogs-repositories ]; then
|
||||||
|
rm -rf /home/${GOGS_USERNAME}/gogs-repositories
|
||||||
|
fi
|
||||||
|
if [ -d $INSTALL_DIR/gogs-repositories ]; then
|
||||||
|
mv $INSTALL_DIR/gogs-repositories /home/${GOGS_USERNAME}/gogs-repositories
|
||||||
|
fi
|
||||||
chown -R ${GOGS_USERNAME}:${GOGS_USERNAME} /home/${GOGS_USERNAME}
|
chown -R ${GOGS_USERNAME}:${GOGS_USERNAME} /home/${GOGS_USERNAME}
|
||||||
|
|
||||||
sed -i "s|gogs version.*|gogs version:$GOGS_VERSION|g" ${COMPLETION_FILE}
|
sed -i "s|gogs version.*|gogs version:$GOGS_VERSION|g" ${COMPLETION_FILE}
|
||||||
|
@ -243,9 +256,6 @@ function restore_local_gogs {
|
||||||
if ! grep -q "gogs domain" ${COMPLETION_FILE}; then
|
if ! grep -q "gogs domain" ${COMPLETION_FILE}; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [ ! -d /home/${GOGS_USERNAME}/gogs-repositories ]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ${#GIT_DOMAIN_NAME} -gt 2 ]; then
|
if [ ${#GIT_DOMAIN_NAME} -gt 2 ]; then
|
||||||
function_check gogs_create_database
|
function_check gogs_create_database
|
||||||
|
@ -274,6 +284,9 @@ function restore_local_gogs {
|
||||||
echo $"Restoring Gogs repos"
|
echo $"Restoring Gogs repos"
|
||||||
function_check restore_directory_from_usb
|
function_check restore_directory_from_usb
|
||||||
restore_directory_from_usb ${temp_restore_dir}repos gogsrepos
|
restore_directory_from_usb ${temp_restore_dir}repos gogsrepos
|
||||||
|
if [ ! -d /home/${GOGS_USERNAME}/gogs-repositories ]; then
|
||||||
|
mkdir /home/${GOGS_USERNAME}/gogs-repositories
|
||||||
|
fi
|
||||||
if [ ! -d ${temp_restore_dir}repos/home/${GOGS_USERNAME}/gogs-repositories ]; then
|
if [ ! -d ${temp_restore_dir}repos/home/${GOGS_USERNAME}/gogs-repositories ]; then
|
||||||
cp -r ${temp_restore_dir}repos/home/${GOGS_USERNAME}/gogs-repositories/* /home/${GOGS_USERNAME}/gogs-repositories/
|
cp -r ${temp_restore_dir}repos/home/${GOGS_USERNAME}/gogs-repositories/* /home/${GOGS_USERNAME}/gogs-repositories/
|
||||||
else
|
else
|
||||||
|
@ -370,6 +383,9 @@ function restore_remote_gogs {
|
||||||
fi
|
fi
|
||||||
echo $"Restoring Gogs repos"
|
echo $"Restoring Gogs repos"
|
||||||
restore_directory_from_friend /root/tempgogsrepos gogsrepos
|
restore_directory_from_friend /root/tempgogsrepos gogsrepos
|
||||||
|
if [ ! -d /home/${GOGS_USERNAME}/gogs-repositories ]; then
|
||||||
|
mkdir /home/${GOGS_USERNAME}/gogs-repositories
|
||||||
|
fi
|
||||||
if [ -d /root/tempgogsrepos/home/${GOGS_USERNAME}/gogs-repositories ]; then
|
if [ -d /root/tempgogsrepos/home/${GOGS_USERNAME}/gogs-repositories ]; then
|
||||||
cp -r /root/tempgogsrepos/home/${GOGS_USERNAME}/gogs-repositories/* /home/${GOGS_USERNAME}/gogs-repositories/
|
cp -r /root/tempgogsrepos/home/${GOGS_USERNAME}/gogs-repositories/* /home/${GOGS_USERNAME}/gogs-repositories/
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue