-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.py
54 lines (50 loc) · 2.41 KB
/
install.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#/usr/bin/env python2.6
# ----------------------------------------------------------------------------------
#
# Copyright (C) 2011-2012 Piotr Styk
#
# ----------------------------------------------------------------------------------
#
# LICENSE:
#
# This file is part of tv.styk.storage.oi.zfs.nfs.
#
# tv.styk.storage.oi.zfs.nfs is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# tv.styk.storage.oi.zfs.nfs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with tv.styk.storage.oi.zfs.nfs; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
import os
import subprocess
RUN_PATH = os.path.dirname(__file__)
# install setuptools
out = subprocess.Popen(['sudo', 'pkg', 'install', 'pkg:/library/python-2/setuptools-26'], stdin=subprocess.PIPE, stdout=subprocess.PIPE).communicate()[0]
print out
# install virtualenv
out = subprocess.Popen(['sudo', 'easy_install', 'virtualenv'], stdin=subprocess.PIPE, stdout=subprocess.PIPE).communicate()[0]
print out
# create bottle virtualenv
os.mkdir(os.path.join(RUN_PATH, 'env'))
out = subprocess.Popen(['virtualenv', 'env/zfs.status'], stdout=subprocess.PIPE).communicate()[0]
print out
# install bottle, paster
out = subprocess.Popen(['./env/zfs.status/bin/pip', 'install', 'bottle'], stdout=subprocess.PIPE).communicate()[0]
print out
out = subprocess.Popen(['./env/zfs.status/bin/pip', 'install', 'paste'], stdout=subprocess.PIPE).communicate()[0]
print out
# install git
out = subprocess.Popen(['sudo', 'pkg', 'install', 'pkg:/developer/versioning/git'], stdin=subprocess.PIPE, stdout=subprocess.PIPE).communicate()[0]
print out
# download status app
os.mkdir(os.path.join(RUN_PATH, 'apps'))
out = subprocess.Popen(['git', 'clone', 'git://github.com/styk-tv/tv.styk.storage.oi.zfs.nfs.git', 'apps/status'], stdout=subprocess.PIPE).communicate()[0]
print out
print "To start zfs.status - source " + os.path.join(RUN_PATH, 'env') + '/zfs.status/bin/activate, cd apps/status, python zfsapi.py, browse http://127.0.0.1:8080/status'