mirror of
https://github.com/ronivay/XenOrchestraInstallerUpdater.git
synced 2026-09-10 20:00:52 -05:00
Merge pull request #337 from ronivay/feat/v6-as-default
feat: change v6 interface as default
This commit is contained in:
@@ -138,8 +138,3 @@ PRESERVE="3"
|
||||
# Configurable network-timeout setting for yarn, in ms.
|
||||
# default: 300000 = 300sec
|
||||
#YARN_NETWORK_TIMEOUT="300000"
|
||||
|
||||
# Enable/Disable XO 6 UI build, accessible at /v6
|
||||
# This is actively developed and enabling it might break install/update
|
||||
# default: false
|
||||
#INCLUDE_V6="false"
|
||||
|
||||
@@ -27,7 +27,6 @@ LISTEN_ADDRESS=${LISTEN_ADDRESS:-""}
|
||||
PROXY_PORT=${PROXY_PORT:-443}
|
||||
INSTALLDIR=${INSTALLDIR:-"/opt/xo"}
|
||||
BRANCH=${BRANCH:-"master"}
|
||||
INCLUDE_V6=${INCLUDE_V6:-"false"}
|
||||
LOGPATH=${LOGPATH:-$(dirname "$(realpath "$0")")/logs}
|
||||
AUTOUPDATE=${AUTOUPDATE:-"true"}
|
||||
PRESERVE=${PRESERVE:-"3"}
|
||||
@@ -717,7 +716,6 @@ function InstallXO {
|
||||
echo
|
||||
printprog "Running installation"
|
||||
runcmd "cd $INSTALLDIR/xo-builds/xen-orchestra-$TIME && yarn --network-timeout ${YARN_NETWORK_TIMEOUT} && yarn --network-timeout ${YARN_NETWORK_TIMEOUT} build"
|
||||
[ "$INCLUDE_V6" == "true" ] && runcmd "cd $INSTALLDIR/xo-builds/xen-orchestra-$TIME && yarn --network-timeout ${YARN_NETWORK_TIMEOUT} run turbo run build --filter @xen-orchestra/web"
|
||||
printok "Running installation"
|
||||
|
||||
# Install plugins (takes care of 3rd party plugins as well)
|
||||
@@ -790,9 +788,6 @@ function InstallXO {
|
||||
if [[ ! -f "$CONFIGPATH/.config/xo-server/config.toml" ]] || [[ "$CONFIGUPDATE" == "true" ]]; then
|
||||
|
||||
echo
|
||||
printinfo "Fixing relative path to xo-web installation in xo-server configuration file"
|
||||
# shellcheck disable=SC1117
|
||||
runcmd "sed -i \"s%#'/any/url' = '/path/to/directory'%'/' = '$INSTALLDIR/xo-web/dist/'%\" $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/sample.config.toml"
|
||||
printinfo "Changing redis connection address in xo-server configuration file"
|
||||
runcmd "sed -i \"s%#uri = 'redis://redis.company.lan/42'%uri = 'redis://127.0.0.1:6379/0'%\" $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server/sample.config.toml"
|
||||
|
||||
@@ -860,10 +855,10 @@ function InstallXO {
|
||||
# install/update is the same procedure so always symlink to most recent installation
|
||||
printinfo "Symlinking fresh xo-server install/update to $INSTALLDIR/xo-server"
|
||||
runcmd "ln -sfn $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-server $INSTALLDIR/xo-server"
|
||||
sleep 2
|
||||
printinfo "Symlinking fresh xo-web install/update to $INSTALLDIR/xo-web"
|
||||
runcmd "ln -sfn $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-web $INSTALLDIR/xo-web"
|
||||
sleep 2
|
||||
printinfo "Symlinking fresh xo-web-v6 install/update to $INSTALLDIR/xo-web-v6"
|
||||
runcmd "ln -sfn $INSTALLDIR/xo-builds/xen-orchestra-$TIME/@xen-orchestra/web $INSTALLDIR/xo-web-v6"
|
||||
printinfo "Symlinking fresh xo-cli install/update to $INSTALLDIR/xo-cli"
|
||||
runcmd "ln -sfn $INSTALLDIR/xo-builds/xen-orchestra-$TIME/packages/xo-cli $INSTALLDIR/xo-cli"
|
||||
printinfo "Symlinking xo-cli script to /usr/local/bin/xo-cli"
|
||||
@@ -981,10 +976,11 @@ function UpdateXO {
|
||||
local INSTALLATIONS="$(runcmd_stdout "find $INSTALLDIR/xo-builds/ -maxdepth 1 -type d -name \"xen-orchestra*\" -printf \"%T@ %p\\n\" | sort -n | cut -d' ' -f2- | head -n -$PRESERVE")"
|
||||
local XO_SERVER_ACTIVE="$(runcmd_stdout "readlink -e $INSTALLDIR/xo-server")"
|
||||
local XO_WEB_ACTIVE="$(runcmd_stdout "readlink -e $INSTALLDIR/xo-web")"
|
||||
local XO_WEB_V6_ACTIVE="$(runcmd_stdout "readlink -e $INSTALLDIR/xo-web-v6")"
|
||||
local XO_PROXY_ACTIVE="$(runcmd_stdout "readlink -e $INSTALLDIR/xo-proxy")"
|
||||
|
||||
for DELETABLE in $INSTALLATIONS; do
|
||||
if [[ "$XO_SERVER_ACTIVE" != "${DELETABLE}"* ]] && [[ "$XO_WEB_ACTIVE" != "${DELETABLE}"* ]] && [[ "$XO_PROXY_ACTIVE" != "${DELETABLE}"* ]]; then
|
||||
if [[ "$XO_SERVER_ACTIVE" != "${DELETABLE}"* ]] && [[ "$XO_WEB_ACTIVE" != "${DELETABLE}"* ]] && [[ "$XO_WEB_V6_ACTIVE" != "${DELETABLE}"* ]] && [[ "$XO_PROXY_ACTIVE" != "${DELETABLE}"* ]]; then
|
||||
runcmd "rm -rf $DELETABLE"
|
||||
fi
|
||||
done
|
||||
@@ -1256,6 +1252,8 @@ function RollBackInstallation {
|
||||
runcmd "ln -sfn $INSTALLATION/packages/xo-server $INSTALLDIR/xo-server"
|
||||
printinfo "Setting $INSTALLDIR/xo-web symlink to $INSTALLATION/packages/xo-web"
|
||||
runcmd "ln -sfn $INSTALLATION/packages/xo-web $INSTALLDIR/xo-web"
|
||||
printinfo "Setting $INSTALLDIR/xo-web-v6 symlink to $INSTALLATION/@xen-orchestra/web"
|
||||
runcmd "ln -sfn $INSTALLATION/@xen-orchestra/web $INSTALLDIR/xo-web-v6"
|
||||
printinfo "Setting $INSTALLDIR/xo-cli symlink to $INSTALLATION/packages/xo-cli"
|
||||
runcmd "ln -sfn $INSTALLATION/packages/xo-cli $INSTALLDIR/xo-cli"
|
||||
echo
|
||||
|
||||
Reference in New Issue
Block a user