Last active
August 29, 2015 13:57
-
-
Save tarelli/9793438 to your computer and use it in GitHub Desktop.
Geppetto-Sibernetic Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import with_statement | |
import os | |
import urllib | |
import tempfile, shutil, zipfile, re, sys | |
from fabric.api import local, lcd, hide, show, settings | |
import os.path as op | |
import sys | |
branch=tag="v0.1.1-alpha" | |
if len(sys.argv) == 2: | |
if sys.argv[1]=="membrane": | |
branch="membranePorting" | |
urls = [ | |
"https://github.com/Openworm/org.geppetto.core/archive/%s.zip"%tag, | |
"https://github.com/Openworm/org.geppetto.model.sph/archive/%s.zip"%branch, | |
"https://github.com/Openworm/org.geppetto.solver.sph/archive/%s.zip"%branch, | |
] | |
folder = 'geppetto-sibernetic' | |
print local('mkdir '+folder, capture=True) | |
for u in urls: | |
print "Downloading: %s and unzipping into %s..."%(u,folder) | |
(zFile, x) = urllib.urlretrieve(u) | |
vz = zipfile.ZipFile(zFile) | |
vz.extractall(folder) | |
os.remove(zFile) | |
packages = ['org.geppetto.core', 'org.geppetto.model.sph', 'org.geppetto.solver.sph'] | |
op.join(folder) | |
for p in packages: | |
if p is 'org.geppetto.core': | |
package_branch=tag | |
else: | |
package_branch=branch | |
if package_branch.startswith('v'): | |
package_branch=package_branch[1:] | |
with lcd(folder): | |
print local('mv %s-%s %s'%(p, package_branch, p), capture=True) | |
dirp = op.join(folder, p) | |
print '**************************' | |
print 'BUILDING ' + dirp | |
print '**************************' | |
with lcd(dirp): | |
print local('mvn install', capture=True) | |
print 'geppetto-sibernetic is ready!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment