Commit 88860428 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

ci: Add option to override schema

parent 2f457344
USAGE = """usage: %%prog [options] command
* %s Create the slave server
* %s: Create the slave server
* %s: Create debian packages for Synnefo in the created server
* %s: Deploy Synnefo in created server
* %s: Run Synnefo unittests
......@@ -54,6 +54,8 @@ def main():
action="store_true", default=False,
help="Download the debian packages that were created"
" during the '%s' step." % BUILD_SYNNEFO_CMD)
parser.add_option("--schema", dest="schema", default=None,
help="Schema for snf-deploy.")
(options, args) = parser.parse_args()
......@@ -91,7 +93,7 @@ def main():
if options.fetch_packages:
if getattr(options, DEPLOY_SYNNEFO_CMD, False):
if getattr(options, TEST_SYNNEFO_CMD, False):
if getattr(options, RUN_BURNIN_CMD, False):
......@@ -429,16 +429,20 @@ class SynnefoCI(object):
_run(cmd, False)
def deploy_synnefo(self):
def deploy_synnefo(self, schema=None):
"""Deploy Synnefo using snf-deploy""""Deploy Synnefo..")
schema = self.config.get('Global', 'schema')
schema_files = os.path.join(self.ci_dir, "schemas/%s/*" % schema)
if schema is None:
schema = self.config.get('Global', 'schema')
self.logger.debug("Will use %s schema" % schema)
schema_dir = os.path.join(self.ci_dir, "schemas/%s" % schema)
if not (os.path.exists(schema_dir) and os.path.isdir(schema_dir)):
raise ValueError("Unknown schema: %s" % schema)
self.logger.debug("Upload schema files to server")
with fabric.quiet():
fabric.put(schema_files, "/etc/snf-deploy/")
fabric.put(os.path.join(schema_dir, "*"), "/etc/snf-deploy/")
self.logger.debug("Change password in nodes.conf file")
cmd = """
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment