summaryrefslogtreecommitdiffstats
path: root/ci/deploy.py
diff options
context:
space:
mode:
authorNarinder Gupta <narinder.gupta@canoncial.com>2015-09-22 23:14:00 -0500
committerNarinder Gupta <narinder.gupta@canoncial.com>2015-09-22 23:16:09 -0500
commit62632e5960810566091186f2ec90bf10d9f2d4af (patch)
treef544af1aec71107b081a645c7fa30958b8851f4e /ci/deploy.py
parente6b6f4362ea2a5bd53ac32118496b61854a0a736 (diff)
Adding the maas deployment script. This will deploy the maas in a
VM. Also add a bootdtrap node. deploy.yaml will contain the config file to deploy the openstack release. deployment.yaml will be lab specific where it will install the maas in a particular lab. Change-Id: I9d19e06eeac55666fc38a8db22fe8ba0bda7a764
Diffstat (limited to 'ci/deploy.py')
-rwxr-xr-xci/deploy.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/ci/deploy.py b/ci/deploy.py
new file mode 100755
index 00000000..078a3df6
--- /dev/null
+++ b/ci/deploy.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+"""
+MAAS Deployment Tool
+"""
+import copy
+import itertools
+import json
+import logging
+import os
+import sys
+import time
+import yaml
+
+from maas_deployer.vmaas.util import CONF as cfg
+
+from maas_deployer.vmaas import (
+ vm,
+ util,
+ template,
+)
+
+
+# Setup logging before imports
+logging.basicConfig(
+ filename='maas_deployer.log',
+ level=logging.DEBUG,
+ format=('%(asctime)s %(levelname)s '
+ '(%(funcName)s) %(message)s'))
+
+log = logging.getLogger('vmaas.main')
+handler = logging.StreamHandler()
+formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
+handler.setFormatter(formatter)
+log.addHandler(handler)
+
+def main():
+
+ maasipaddress = str(sys.argv);
+
+ script = """
+ sudo apt-get install git -y
+ git clone https://gerrit.opnfv.org/gerrit/joid
+ juju init -y
+ cp /home/juju/.juju/environments.yaml ~/.juju/
+ cd joid/ci/
+ ./deploy.sh
+ """
+ try:
+ util.exec_script_remote('ubuntu', maasipaddress[1], script)
+ except:
+ # Remove console handler to avoid displaying the exception twice
+ log.removeHandler(handler)
+ log.exception("MAAS deployment failed.")
+ raise
+
+if __name__ == '__main__':
+ main()