Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
88860428
Commit
88860428
authored
Jul 31, 2013
by
Christos Stavrakakis
Browse files
ci: Add option to override schema
parent
2f457344
Changes
2
Hide whitespace changes
Inline
Side-by-side
ci/snf-ci
View file @
88860428
...
...
@@ -25,7 +25,7 @@ CLEAN_CONFIG_CMDS = [CREATE_SERVER_CMD, ALL_CMDS]
USAGE
=
"""usage: %%prog [options] command
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
:
synnefo_ci
.
fetch_packages
()
if
getattr
(
options
,
DEPLOY_SYNNEFO_CMD
,
False
):
synnefo_ci
.
deploy_synnefo
()
synnefo_ci
.
deploy_synnefo
(
schema
=
options
.
schema
)
if
getattr
(
options
,
TEST_SYNNEFO_CMD
,
False
):
synnefo_ci
.
unit_test
()
if
getattr
(
options
,
RUN_BURNIN_CMD
,
False
):
...
...
ci/utils.py
View file @
88860428
...
...
@@ -429,16 +429,20 @@ class SynnefoCI(object):
_run
(
cmd
,
False
)
@
_check_fabric
def
deploy_synnefo
(
self
):
def
deploy_synnefo
(
self
,
schema
=
None
):
"""Deploy Synnefo using snf-deploy"""
self
.
logger
.
info
(
"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
=
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment