sudo apt-get install libnss-mdns
sudo apt-get install wicd-curses
sudo wicd-curses
wget http://nodejs.org/dist/v0.10.16/node-v0.10.16-linux-arm-pi.tar.gz
tar -xvzf node-v0.10.16-linux-arm-pi.tar.gz
node-v0.10.16-linux-arm-pi/bin/node --version
NODE_JS_HOME=/home/pi/node-v0.10.16-linux-arm-pi
PATH=$PATH:$NODE_JS_HOME/bin
http://stackoverflow.com/questions/12133860/accessing-the-gpio-of-a-raspberry-pi-without-sudo
https://learn.adafruit.com/raspberry-pi-e-mail-notifier-using-leds/wire-leds
https://github.com/EnotionZ/GpiO
npm install -g coffee-script
http://clock.co.uk/blog/deploying-nodejs-apps
cat ~/.ssh/config
Host pi
HostName raspberrypi.local
User pi
mkdir -p /home/pi/deploy/pi-time
mkdir -p /home/pi/git-repos/pi-time
cd /home/pi/git-repos/pi-time
git init --bare
vi hooks/post-receive
Put this in the hooks/post-receive
:
#!/usr/bin/env bash
set -u
set -e
NODE_JS_HOME=/home/pi/node-v0.10.16-linux-arm-pi
PATH=$PATH:$NODE_JS_HOME/bin
export GIT_WORK_TREE="/home/pi/deploy/pi-time"
export NODE_VERSION="0.10"
echo "--> Checking out..."
git checkout -f
echo "--> Installing libraries..."
cd "$GIT_WORK_TREE"
npm install
echo "--> Stopping app"
node_modules/forever/bin/forever stop led-server.coffee
echo "--> Starting app"
node_modules/forever/bin/forever start -c node_modules/coffee-script/bin/coffee led-server.coffee
Make the post-receive
hook executable:
chmod +x post-receive
git remote add pi ssh://pi/home/pi/git-repos/pi-time
git remote -v
git push pi master
mkdir -p /home/pi/deploy/pi-time
https://gist.github.com/tlrobinson/8035884
#!/usr/bin/env bash
set -u
set -e
NODE_JS_HOME=/home/pi/node-v0.10.16-linux-arm-pi
PATH=$PATH:$NODE_JS_HOME/bin
export GIT_WORK_TREE="/home/pi/deploy/pi-time"
export NODE_VERSION="0.10"
echo "--> Checking out..."
git checkout -f
echo "--> Installing libraries..."
cd "$GIT_WORK_TREE"
npm install
echo "--> Stopping app"
node_modules/forever/bin/forever stop led-server.coffee
echo "--> Starting app"
node_modules/forever/bin/forever start -c node_modules/coffee-script/bin/coffee led-server.coffee
crontab -e
Add this to the end of the file:
@reboot /home/pi/deploy/pi-time/starter.sh