-
Notifications
You must be signed in to change notification settings - Fork 54
/
.travis-buildout.cfg
119 lines (106 loc) · 4.33 KB
/
.travis-buildout.cfg
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
[buildout]
parts =
environment
pginit
configs
syseggs
vic-build
symlinks
paths
rheas
test-nowcast-data
test-forecast-data
tests
develop = .
[paths]
recipe = collective.recipe.template
input = src/rpath.in
output = src/rpath.py
[environment]
recipe = collective.recipe.environment
[syseggs]
recipe = osc.recipe.sysegg
eggs =
numpy
gdal
argparse
scipy
dateutil
h5py
psycopg2
netCDF4
[rheas]
recipe = zc.recipe.egg
interpreter = rheaspy
extra-paths =
${buildout:directory}/lib/python2.7/site-packages
/usr/lib/python2.7/dist-packages
/usr/local/lib/python2.7/dist-packages
eggs =
rheas
[pginit]
recipe = collective.recipe.cmd
on_install = true
on_update = false
cmds =
sudo -u postgres createuser --superuser ${environment:USER}
createdb rheas
echo 'CREATE EXTENSION postgis;CREATE EXTENSION postgis_topology;' | psql -U ${environment:USER} -d rheas
[vic-build]
recipe = collective.recipe.cmd
on_install = true
on_update = true
cmds =
cd ${buildout:directory}/external/VIC/src
make
[symlinks]
recipe = cns.recipe.symlink
symlink =
${buildout:directory}/external/VIC/src/vicNl = ${buildout:directory}/bin/vicNl
${buildout:directory}/external/dssat/DSSAT_Ex.exe = ${buildout:directory}/bin/DSSAT_Ex.exe
autocreate = false
[configs]
recipe = collective.recipe.cmd
on_install = true
on_update = false
cmds =
echo "begin; create schema vic; create schema dssat; commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
echo "begin; create schema crops; commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
echo "begin; create table vic.input (resolution double precision,snowbandfile text,vegparam text,veglib text,soilfile text,rootzones integer,basefile text);commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
echo "begin; insert into vic.input values (0.25, 'vic/global_snowbands_0.25deg.txt', 'vic/global_lai_0.25deg.txt', 'vic/vic_veglib.txt', 'vic/global_soil_0.25deg.txt', 2, 'vic/dssat.inp.base'); commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
echo "begin; create schema precip; create schema tmax; create schema tmin; create schema wind; create schema lai; commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
echo "begin; create table dssat.cultivars (gid serial primary key, ensemble int, geom geometry, p1 numeric, p2 numeric, p5 numeric, g2 numeric, g3 numeric, phint numeric); commit;" | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
gunzip ${buildout:directory}/data/vic/global_snowbands_0.25deg.txt.gz
gunzip ${buildout:directory}/data/vic/global_lai_0.25deg.txt.gz
gunzip ${buildout:directory}/data/vic/global_soil_0.25deg.txt.gz
gunzip ${buildout:directory}/scripts/vicsoils.sql.gz
${buildout:directory}/bin/psql -d rheas -U ${environment:USER} -f ${buildout:directory}/scripts/vicsoils.sql
[dssat]
recipe = collective.recipe.cmd
on_install = true
on_update = false
cmds =
wget https://googledrive.com/host/0B-cBXVuysNV1TXVYd1BwSE05Zlk/MARS_CropMask250m_v2.2_AFR.tif.gz -P ${buildout:directory}/data/dssat/
gunzip ${buildout:directory}/data/dssat/MARS_CropMask250m_v2.2_AFR.tif.gz
${buildout:directory}/bin/raster2pgsql -d -I -t auto -s 4326 ${buildout:directory}/data/dssat/MARS_CropMask250m_v2.2_AFR.tif dssat.cropland | ${buildout:directory}/bin/psql -d rheas -U ${environment:USER}
${buildout:directory}/bin/raster2pgsql -s 4326 -d -t auto -I ${buildout:directory}/data/dssat/sage/Maize.crop.calendar.fill/plant.start.asc crops.plantstart | ${buildout:directory}/bin/psql -d rheas
${buildout:directory}/bin/raster2pgsql -s 4326 -a -t auto -I ${buildout:directory}/data/dssat/sage/Maize.2.crop.calendar.fill/plant.start.asc crops.plantstart | ${buildout:directory}/bin/psql -d rheas
[tests]
recipe = pbp.recipe.noserunner
eggs = rheas
script = test
[test-nowcast-data]
recipe = collective.recipe.template
input = data/tests/nowcast.in
output = data/tests/nowcast.conf
[test-forecast-data]
recipe = collective.recipe.template
input = data/tests/forecast.in
output = data/tests/forecast.conf
[eafrica]
recipe = collective.recipe.cmd
shell = bash
on_install = true
on_update = false
cmds =
sh ${buildout:directory}/scripts/init_db.sh