Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorSebastian Dziallas <sebastian@when.com>2009-03-19 15:20:51 (GMT)
committer Sebastian Dziallas <sebastian@when.com>2009-03-19 15:20:51 (GMT)
commitf997dd67c7cddc6d8ede11d94e02b79c6309d98e (patch)
tree3f10ebc8f813243ced1ac77edac357ea5704feb9 /build
parent4127f821c6114d6355d30a87561278f16c0bdaa8 (diff)
very basic try to update build script for soas-2
Diffstat (limited to 'build')
-rwxr-xr-xbuild36
1 files changed, 24 insertions, 12 deletions
diff --git a/build b/build
index a9fa5e2..27116fb 100755
--- a/build
+++ b/build
@@ -6,36 +6,48 @@ import sys
from time import gmtime, strftime
import imgcreate
+import appcreate
+import tarfile
base_dir = os.path.dirname(__file__)
images_dir = os.path.join(base_dir, 'images')
+appliances_dir = os.path.join(base_dir, 'appliances')
cache_dir = os.path.join(base_dir, 'cache')
last_file = os.path.join(images_dir, 'last')
def main():
- if not os.path.exists(images_dir):
- os.mkdir(images_dir)
- image_date = strftime("%Y%m%d%H%M", gmtime())
- image_name = 'Soas2-%s' % image_date
- if os.path.exists(os.path.join(images_dir, image_name + '.iso')):
- print 'Image %s exist already' % image_name
+ if not os.path.exists(appliances_dir):
+ os.mkdir(appliances_dir)
+
+ appliance_date = strftime("%Y%m%d", gmtime())
+ appliance_name = 'soas2-%s' % appliance_date
+ if os.path.exists(os.path.join(appliances_dir, appliance_name + '.tar.gz')):
+ print 'Appliance %s exist already' % appliance_name
sys.exit(2)
- ks = imgcreate.read_kickstart(os.path.join(base_dir, 'soas-sugar.ks'))
- creator = imgcreate.LiveImageCreator(ks, image_name, image_name)
+ ks = imgcreate.read_kickstart(os.path.join(base_dir, 'appliance.ks'))
+ creator = appcreate.ApplianceImageCreator(ks, 'soas2-appliance', 'vmdk', '512', '1')
try:
- creator.mount(cachedir=cache_dir)
+ creator.mount(cache_dir)
creator.install()
creator.configure()
creator.unmount()
- creator.package(destdir=images_dir)
+ creator.package(appliances_dir, package, include)
except imgcreate.CreatorError, e:
- logging.error("Error creating Live CD : %s" % e)
+ logging.error("Unable to create appliance : %s" % e)
return 1
finally:
- creator.cleanup()
+ creator.cleanup()
+
+ tarfile.open(appliance_name, 'w:gz')
+ tarfile.add('soas2-appliance.vmdk')
+ tarfile.add('soas2-appliance.xml')
+ tarfile.close()
+
+ os.remove('soas2-appliance.vmdk')
+ os.remove('soas2-appliance.xml')
return 0