This repository has been archived by the owner on Mar 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
68 lines (59 loc) · 2.31 KB
/
fabfile.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from fabric.api import run, env, local, sudo
"""
@Author : Fawaz F. PARAISO
LICENCE : GPL
"""
# Hosts
env.hosts = ['192.168.20.200']
# Hosts Users
env.user = 'ubuntu'
#Maven settings
env.mavenHome = "\'export PATH=${M2_HOME}/bin:${PATH}\'"
# Maven command
env.mvn = '/usr/local/maven/bin/mvn'
env.javaHome ="\'export PATH=${JAVA_HOME}/bin:{$PATH}\'"
env.frascatiHome = "\'export PATH=${FRASCATI_HOME}/bin:${PATH}\'"
# replace this Credential by your own.
env.key_filename = '/home/fernand/.euca/adamcloudkey.priv'
def updateSourceListe():
sudo('echo "deb http://archive.canonical.com/ lucid partner" >> /etc/apt/sources.list')
run('echo "/etc/apt/source.list update successfully ..................."')
def install_java():
sudo('apt-get update')
sudo('apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk sun-java6-plugin sun-java6-fonts')
sudo('echo "export JAVA_HOME=\'/usr/lib/jvm/java-6-sun-1.6.0.26/jre\'" >> ~/.bashrc')
sudo('echo %(javaHome)s >> ~/.bashrc' %env)
run('echo "Java Installation finished successfully............"')
def install():
updateSourceListe()
install_java()
install_maven()
install_frascati()
def install_maven():
run('echo "download Maven" ')
run('wget http://mirror.ibcp.fr/pub/apache//maven/binaries/apache-maven-2.2.1-bin.tar.gz;')
run('mkdir -p ~/install;')
run('mv apache-maven-2.2.1-bin.tar.gz ~/install;')
run('cd ~/install && tar -xzvf apache-maven-2.2.1-bin.tar.gz;')
sudo(' cd ~/install && mv apache-maven-2.2.1 /usr/local/maven')
sudo('echo "export M2_HOME=\'/usr/local/maven/\'" >> ~/.bashrc')
sudo('echo %(mavenHome)s >> ~/.bashrc' %env)
sudo('. .bashrc')
run('%(mvn)s -v'%env)
def install_frascati():
sudo('aptitude install -y unzip')
run('echo "download FraSCAti" ')
run('wget http://download.forge.objectweb.org/frascati/frascati-1.4-bin.zip;')
run('mkdir -p ~/install;')
run('mv frascati-1.4-bin.zip ~/install;')
run('cd ~/install && unzip frascati-1.4-bin.zip ;')
sudo('echo "export FRASCATI_HOME=\'~/install/frascati-runtime-1.4\'" >> ~/.bashrc')
sudo('echo %(frascatiHome)s >> ~/.bashrc' %env)
sudo('. .bashrc')
def uptime():
run('uptime')
def host_info():
print 'Checking lsb_release of host: ', env.host
run('lsb_release -a ')