From 1d89355658aa9a0a6916ac42b3e410338c8343d4 Mon Sep 17 00:00:00 2001 From: watsonb8 Date: Mon, 30 Dec 2019 20:15:57 -0500 Subject: [PATCH] Added deploy script --- deploy.sh | 21 +++++++++++++++++++++ package.json | 1 + 2 files changed, 22 insertions(+) create mode 100755 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..cc445a0 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,21 @@ +#!/bin/bash +remote_user="bmw" +remote_server="192.168.1.31" +deploy_location="/home/bmw/homebridge-hue-chase" + +#build +tsc --build +#copy files to remote machine +scp -r bin $remote_user@$remote_server:$deploy_location +scp package.json $remote_user@$remote_server:$deploy_location + +#install package +ssh -t $remote_user@$remote_server "sudo npm install -g --unsafe-perm $deploy_location" + +#restart service +ssh -t +ssh -t $remote_user@$remote_server "sudo systemctl restart homebridge.service" +ssh -t $remote_user@$remote_server "sudo systemctl status homebridge.service" + +echo done +exit diff --git a/package.json b/package.json index 3489b30..9944936 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "node": ">=7.6.0" }, "dependencies": { + "@types/node": "^13.1.2", "@types/node-hue-api": "^2.3.0", "homebridge": "^0.4.50", "node-hue-api": "^4.0.0"