Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add post-upgrade script #814

Merged
merged 3 commits into from
Mar 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tools/post-upgrade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Performs any necessary steps after the main upgrade process is complete.

NODE_VERSION="--lts"
nvm install ${NODE_VERSION}
nvm use ${NODE_VERSION}
# always use most recent version (lts)
nvm alias default node

# Upgrade gateway-addon Python package
_url="git+https://github.com/mozilla-iot/gateway-addon-python#egg=gateway_addon"
sudo pip2 install -U "$_url"
sudo pip3 install -U "$_url"
2 changes: 2 additions & 0 deletions tools/rollback.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ function checkCounter() {

if [ -d "gateway_old" ] && $(recentEnough "gateway_old") && $(checkCounter); then
systemctl stop mozilla-iot-gateway
# TODO: remove when gateway_old is not 0.3.1
nvm alias default v7.10.1
rm -fr gateway_failed
mv gateway gateway_failed
mv gateway_old gateway
Expand Down
3 changes: 3 additions & 0 deletions tools/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,7 @@ rm -fr gateway_old
mv $gateway_old gateway_old
mv /tmp/gateway gateway
touch gateway_old/package.json

./gateway/post-upgrade.sh

sudo systemctl start mozilla-iot-gateway.service