diff options
Diffstat (limited to 'scripts/upgrade')
| -rw-r--r-- | scripts/upgrade | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/scripts/upgrade b/scripts/upgrade index f070bbd..2a9b0fe 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,6 +40,14 @@ sudo systemctl stop mastodon-*.service # Change owner of live folder sudo chown -R $app: $final_path/live +# upgrade Node.js v4 to v6 +node_version=$(nodejs --version) +if [[ $node_version =~ ^v4.*$ ]]; then + pushd /opt + curl -sL https://deb.nodesource.com/setup_6.x | sudo bash - + sudo apt-get -y install nodejs +fi + # Download Mastodon sudo su - $app <<PULLCOMMANDS pushd ~/live @@ -50,11 +58,24 @@ PULLCOMMANDS # Switch branch to tagged release cd $final_path/live +url=$(curl -s https://api.github.com/repos/tootsuite/mastodon/releases/latest | sort -r | head -1 | cut -d\" -f4) +version=$(echo $url | cut -d/ -f8) sudo su - $app <<SWITCHCOMMANDS pushd ~/live -git checkout $(git tag | tail -n 1) +git checkout $version SWITCHCOMMANDS +# upgrade Node.js v4 to v6 +node_version=$(nodejs --version) +if [[ $node_version =~ ^v4.*$ ]]; then + pushd /opt + curl -sL https://deb.nodesource.com/setup_6.x | sudo bash - + sudo apt-get -y install nodejs +fi + +# add additional package for release 1.4 +ynh_package_install pkg-config libprotobuf-dev protobuf-compiler + # Apply Mastodon upgrade sudo su - $app <<COMMANDS pushd ~/live |
