Deployment: fabfile.py

File fabfile.py, 1.2 KB (added by Matthias Vogelgesang, 12 years ago)

IEKP deploy script

Line 
1import os
2from fabric.api import run, env, cd
3
4
5ROOT_SOURCE = 'ftp://root.cern.ch/root/root_v5.34.05.source.tar.gz'
6ROOT_CFLAGS = ' '.join(['--enable-mathmore',
7                        '--enable-minuit2',
8                        '--enable-fftw3',
9                        '--enable-xml',
10                        '--prefix=/usr/local'])
11
12VTK_SOURCE = 'http://www.vtk.org/files/release/5.10/vtk-5.10.1.tar.gz'
13
14env.use_ssh_config = True
15env.user = 'root'
16env.hosts = ['compute1',
17             'compute2']
18
19
20def wget(url):
21    run('wget %s' % url)
22
23
24def untar(filename):
25    run('tar xfz %s' % filename)
26
27
28def basepath(path):
29    return os.path.join('$HOME', 'software', path)
30
31
32def fetch():
33    with cd(basepath('.')):
34        wget(ROOT_SOURCE)
35        untar(os.path.basename(ROOT_SOURCE))
36
37        wget(VTK_SOURCE)
38        untar(os.path.basename(VTK_SOURCE))
39
40
41def install():
42    fetch()
43
44    with cd(basepath('root')):
45        run('./configure %s' % ROOT_CFLAGS)
46        run('make -j12')
47        run('make install')
48
49    with cd(basepath('VTK5.10.1')):
50        run('cmake . -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release')
51        run('make -j12')
52        run('make install')
53
54
55def deploy():
56    run('zypper in gsl gsl-devel')
57    install()
58    run('ldconfig')