Skip to content

Commit

Permalink
Merge pull request #202 from ronivay/feat/yarn-timeout
Browse files Browse the repository at this point in the history
feat: add default yarn network-timeout and make it configurable
  • Loading branch information
ronivay authored Nov 1, 2023
2 parents 96c9125 + 7b4a600 commit 4f8de78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions sample.xo-install.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,7 @@ PRESERVE="3"
# supported protocols are udp and tcp
# example: tcp://syslog.company.lan:514
#SYSLOG_TARGET=""

# Configurable network-timeout setting for yarn, in ms.
# default: 300000 = 300sec
#YARN_NETWORK_TIMEOUT="300000"
5 changes: 3 additions & 2 deletions xo-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ GENSUDO="${GENSUDO:-"false"}"
INSTALL_REPOS="${INSTALL_REPOS:-"true"}"
SYSLOG_TARGET="${SYSLOG_TARGET:-""}"
YARN_CACHE_CLEANUP="${YARN_CACHE_CLEANUP:-"false"}"
YARN_NETWORK_TIMEOUT="${YARN_NETWORK_TIMEOUT:-"300000"}"

# set variables not changeable in configfile
TIME=$(date +%Y%m%d%H%M)
Expand Down Expand Up @@ -707,7 +708,7 @@ function InstallXO {
printinfo "xo-server and xo-web build takes quite a while. Grab a cup of coffee and lay back"
echo
printprog "Running installation"
runcmd "cd $INSTALLDIR/xo-builds/xen-orchestra-$TIME && yarn && yarn build"
runcmd "cd $INSTALLDIR/xo-builds/xen-orchestra-$TIME && yarn --network-timeout ${YARN_NETWORK_TIMEOUT} && yarn --network-timeout ${YARN_NETWORK_TIMEOUT} build"
printok "Running installation"

# Install plugins (takes care of 3rd party plugins as well)
Expand Down Expand Up @@ -990,7 +991,7 @@ function InstallXOProxy {
printinfo "xo-proxy build takes quite a while. Grab a cup of coffee and lay back"
echo
printprog "Running installation"
runcmd "cd $INSTALLDIR/xo-builds/xen-orchestra-$TIME && yarn && yarn build"
runcmd "cd $INSTALLDIR/xo-builds/xen-orchestra-$TIME && yarn --network-timeout ${YARN_NETWORK_TIMEOUT} && yarn --network-timeout ${YARN_NETWORK_TIMEOUT} build"
printok "Running installation"

# shutdown possibly running xo-server
Expand Down

0 comments on commit 4f8de78

Please sign in to comment.