Commit fcb74522 authored by Christos Stavrakakis's avatar Christos Stavrakakis

Merge branch 'feature-ci-deploy3' into develop

parents b37c2112 6a654b7f
#!/usr/bin/env python
"""
Build Synnefo packages for debian
"""
from utils import SynnefoCI
def autopkg_debian():
"""Build synnefo packages for debian"""
synnefo_ci = SynnefoCI()
synnefo_ci.build_synnefo()
if __name__ == "__main__":
autopkg_debian()
#!/usr/bin/env python
"""
Deploy Synnefo using snf-deploy
"""
from utils import SynnefoCI
def deploy_synnefo():
"""Deploy Synnefo using snf-deploy"""
synnefo_ci = SynnefoCI()
synnefo_ci.deploy_synnefo()
if __name__ == "__main__":
deploy_synnefo()
#!/usr/bin/env python
"""
Download Synnefo packages
"""
from utils import SynnefoCI
def fetch_packages():
"""Download Synnefo packages"""
synnefo_ci = SynnefoCI()
synnefo_ci.fetch_packages()
if __name__ == "__main__":
fetch_packages()
......@@ -5,8 +5,9 @@ build_timeout = 240
apt_repo = http://apt.dev.grnet.gr squeeze/
# Synnefo git repo
synnefo_repo = https://code.grnet.gr/git/synnefo
# Git branch to test (specify sha1 or branch name)
synnefo_branch = HEAD
# Git branch to test (specify sha1 or branch name). If not set, the
# branch/sha will result from the current repository.
synnefo_branch =
# snf-deploy git repo
deploy_repo = https://code.grnet.gr/git/snf-deploy
# Defines the schema that snf-deploy will use
......@@ -20,19 +21,16 @@ git_config_name = Buildbot
git_config_mail = synnefo@builder.dev.grnet.gr
# Url to fetch ssh public keys
public_ssh_keys_url =
# Network address from which we allow access to server
filter_access_network = 195.251.29.0/24,62.217.123.39
# Network address from which we allow access to server. If not set, access
# to server is not restricted.
filter_access_network =
# Config file to save temporary options (eg IPs, passwords etc)
temporary_config = /tmp/ci_temp_conf
[Deployment]
# Credentials
auth_url = https://accounts.okeanos.io/identity/v2.0/
token =
# If we deploy on okeanos.io we have to set this to True
# The server will reside besides a NAT and we have to compute ssh port
deploy_on_io = True
# Choose the 'cloud' to use from .kamakirc
kamaki_cloud =
# Server name to use for our machine
server_name = Synnefo Deployment
# Flavor ID to use
......
#!/usr/bin/env python
"""
Run burnin functional test suite
"""
from utils import SynnefoCI
def run_burnin():
"""Run burnin functional test suite"""
synnefo_ci = SynnefoCI()
synnefo_ci.run_burnin()
if __name__ == "__main__":
run_burnin()
......@@ -35,6 +35,7 @@ snf-webproject = stable
snf-pithos-app = stable
snf-pithos-backend = stable
snf-tools = stable
python-django-south = squeeze-backports
[ganeti]
......
#!/usr/bin/env python
"""
Setup slave server
"""
from utils import SynnefoCI
def setup_slave():
"""Setup slave server"""
synnefo_ci = SynnefoCI(cleanup_config=True)
# Get token from /nfs/token
try:
token = open("/nfs/synnefo_token").read().strip()
synnefo_ci.write_config('token', token, 'Deployment')
except:
pass
# Build slave server
synnefo_ci.create_server()
# Copy synnefo repo to server
synnefo_ci.clone_repo()
if __name__ == "__main__":
setup_slave()
#!/usr/bin/env python
"""
"""
import os
from utils import SynnefoCI
from optparse import OptionParser
CREATE_SERVER_CMD = "create"
BUILD_SYNNEFO_CMD = "build"
BUILD_DOCS_SYNNEFO_CMD = "docs"
DEPLOY_SYNNEFO_CMD = "deploy"
TEST_SYNNEFO_CMD = "test"
RUN_BURNIN_CMD = "burnin"
ALL_CMDS = "all"
AVAILABLE_COMMANDS = [
CREATE_SERVER_CMD,
BUILD_SYNNEFO_CMD,
BUILD_DOCS_SYNNEFO_CMD,
DEPLOY_SYNNEFO_CMD,
TEST_SYNNEFO_CMD,
RUN_BURNIN_CMD,
]
CLEAN_CONFIG_CMDS = [CREATE_SERVER_CMD, ALL_CMDS]
USAGE = """usage: %%prog [options] command
command:
* %s: Create the slave server
* %s: Create debian packages for Synnefo in the created server
* %s: Create documentation for Synnefo in the created server
* %s: Deploy Synnefo in created server
* %s: Run Synnefo unittests
* %s: Run snf-burnin in the deployed Synnefo
* %s: Run all the available commands
""" % tuple([CREATE_SERVER_CMD,
BUILD_SYNNEFO_CMD,
BUILD_DOCS_SYNNEFO_CMD,
DEPLOY_SYNNEFO_CMD,
TEST_SYNNEFO_CMD,
RUN_BURNIN_CMD,
ALL_CMDS])
def main():
parser = OptionParser(usage=USAGE)
parser.add_option("--conf", dest="config_file", default=None,
help="Configuration file for SynnefoCI script"),
parser.add_option("-c", "--cloud", dest="kamaki_cloud", default=None,
help="Use specified cloud, as is in .kamakirc"),
parser.add_option("-f", "--flavor", dest="flavor", default=None,
help="Name of flavor to use for the server.")
parser.add_option("-i", "--image", dest="image", default=None,
help="UUID of image to use for the server.")
parser.add_option("--fetch-packages", dest="fetch_packages",
default=None,
help="Download the debian packages that were created"
" during the '%s' step in this directory" %
BUILD_SYNNEFO_CMD)
parser.add_option("--fetch-docs", dest="fetch_docs",
default=None,
help="Download the documentation that was created"
" during the '%s' step in this directory" %
BUILD_DOCS_SYNNEFO_CMD)
parser.add_option("--schema", dest="schema", default=None,
help="Schema for snf-deploy.")
(options, args) = parser.parse_args()
if len(args) != 1:
msg = "ERROR: Command takes exactly one argument"
parser.print_help()
print
print msg
return
command = args[0]
if command == ALL_CMDS:
for cmd in AVAILABLE_COMMANDS:
setattr(options, cmd, True)
elif command not in AVAILABLE_COMMANDS:
msg = "ERROR: Unknown command: %s" % command
parser.print_help()
print
print msg
return
else:
setattr(options, command, True)
cleanup_config = command in CLEAN_CONFIG_CMDS
synnefo_ci = SynnefoCI(config_file=options.config_file,
cleanup_config=cleanup_config,
cloud=options.kamaki_cloud)
if getattr(options, CREATE_SERVER_CMD, False):
synnefo_ci.create_server(flavor_id=options.flavor,
image_id=options.image)
synnefo_ci.clone_repo()
if getattr(options, BUILD_SYNNEFO_CMD, False):
synnefo_ci.build_synnefo()
if options.fetch_packages:
dest = os.path.abspath(options.fetch_packages)
synnefo_ci.fetch_packages(dest=dest)
if getattr(options, BUILD_DOCS_SYNNEFO_CMD, False):
synnefo_ci.build_documentation()
if options.fetch_docs:
dest = os.path.abspath(options.fetch_docs)
synnefo_ci.fetch_documentation(dest=dest)
if getattr(options, DEPLOY_SYNNEFO_CMD, False):
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):
synnefo_ci.run_burnin()
if __name__ == "__main__":
main()
#!/usr/bin/env python
"""
Run Synnefo unit test suite
"""
from utils import SynnefoCI
def unit_test():
"""Run Synnefo unit test suite"""
synnefo_ci = SynnefoCI()
synnefo_ci.unit_test()
if __name__ == "__main__":
unit_test()
This diff is collapsed.
......@@ -66,7 +66,7 @@ CLASSIFIERS = [
# Package requirements
INSTALL_REQUIRES = [
'Django>=1.2, <1.3',
'South>=0.7, <=0.7.3',
'South>=0.7.3',
'httplib2>=0.6.0',
'snf-common',
'django-tables2',
......
......@@ -62,7 +62,7 @@ INSTALL_REQUIRES = [
'pycurl>=7.19.0',
'python-dateutil>=1.4.1',
'IPy>=0.70',
'South>=0.7, <=0.7.3',
'South>=0.7.3',
'pycrypto>=2.1.0',
'puka',
'python-daemon>=1.5.5, <1.6',
......
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