-
Notifications
You must be signed in to change notification settings - Fork 0
/
fab_node.py
31 lines (25 loc) · 978 Bytes
/
fab_node.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
This recipe will help you to setup the most recent version of Node.js.
usage:
fab -f fab_node.py -H <hostname> setup_node
"""
from fabric.api import task, sudo, cd
@task
def setup_node():
"""
setup and configure Node.js
https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
"""
sudo("apt-get -y install python g++ make checkinstall")
# download and unzip Node
with cd("/tmp"):
sudo("wget -N http://nodejs.org/dist/node-latest.tar.gz")
sudo("tar xzvf node-latest.tar.gz")
# builf package and setup it
with cd("/tmp/node-v*"):
sudo("./configure")
print '======================= IMPORTANT ============================='
print 'remove the "v" in front of the version number in the dialog'
print '==============================================================='
sudo("checkinstall")
sudo("dpkg -i node_*") # can be deleted with: sudo dpkg -r node