Improve peertube upgrade

This commit is contained in:
Bob Mottram 2018-06-01 11:15:36 +01:00
parent 5f45cb66b7
commit 2824837420
1 changed files with 33 additions and 6 deletions

View File

@ -434,8 +434,38 @@ function upgrade_peertube {
function_check set_repo_commit
set_repo_commit $PEERTUBE_DIR "peertube commit" "$PEERTUBE_COMMIT" $PEERTUBE_REPO
cd "$PEERTUBE_DIR/scripts" || exit 7824552627
sudo -u peertube ./upgrade.sh $PEERTUBE_DIR
if ! npm install -g yarn@1.5.1; then
echo $'Failed to install yarn'
exit 79353234
fi
yarn add -D webpack --network-concurrency 1
if ! yarn install; then
echo $'Failed to run yarn install'
exit 63754235
fi
if ! npm install -g npm@4; then
# https://github.com/KraigM/homebridge-harmonyhub/issues/119
echo $'Failed to downgrade npm'
npm install -g "npm@${NPM_VERSION}"
cp /root/.npm-global/bin/npm /usr/local/bin/npm
exit 3476835
fi
cp /root/.npm-global/bin/npm /usr/local/bin/npm
if ! npm install; then
echo $'Failed to install peertube'
npm install -g "npm@${NPM_VERSION}"
cp /root/.npm-global/bin/npm /usr/local/bin/npm
exit 7835243
fi
if ! npm install -g "npm@${NPM_VERSION}"; then
echo $'Failed to restore npm after downgrade'
exit 5737583
fi
cp /root/.npm-global/bin/npm /usr/local/bin/npm
npm run build
# This doesn't appear to work
#sudo -u peertube ./upgrade.sh $PEERTUBE_DIR
chown -R peertube:peertube $PEERTUBE_DIR
systemctl start peertube
@ -1044,10 +1074,7 @@ function install_peertube {
exit 5737583
fi
cp /root/.npm-global/bin/npm /usr/local/bin/npm
if ! npm run build; then
echo $'Failed to build peertube'
exit 5293593
fi
npm run build
PEERTUBE_ONION_HOSTNAME=$(add_onion_service peertube 80 ${PEERTUBE_ONION_PORT})