aboutsummaryrefslogtreecommitdiff
path: root/src_py
diff options
context:
space:
mode:
authorbozo.kopic <bozo.kopic@gmail.com>2017-08-18 15:24:16 +0200
committerbozo.kopic <bozo.kopic@gmail.com>2017-08-18 15:24:16 +0200
commit6424cbc7cef9185564c5e3574575b4a5e617b9cb (patch)
tree82b04cc2e3344a9743d67acf9fce4c6be6e005f5 /src_py
parent6e52ded7a8c4e49102f7a10a942f65e4490ea3bd (diff)
documentation
Diffstat (limited to 'src_py')
-rw-r--r--src_py/hatter/executor.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/src_py/hatter/executor.py b/src_py/hatter/executor.py
index 271d60d..2d1ae2a 100644
--- a/src_py/hatter/executor.py
+++ b/src_py/hatter/executor.py
@@ -23,20 +23,21 @@ def run(log, repo_path, commit='HEAD', archive_name='hatter_archive'):
_git_archive(repo_path, commit, archive_path)
log.info('loading project configuration')
conf = _load_conf(archive_path)
- log.info('starting virtual machine')
- with contextlib.closing(_VM(conf['vm'])) as vm:
- log.info('creating SSH connection')
- with contextlib.closing(_SSH(conf['ssh'], vm.address)) as ssh:
- log.info('transfering repository to virtual machine')
- ssh.execute('rm -rf {} {}'.format(archive_file_name,
- archive_name))
- ssh.upload(archive_path, archive_file_name)
- ssh.execute('mkdir {}'.format(archive_name))
- ssh.execute('tar xf {} -C {}'.format(archive_file_name,
- archive_name))
- log.info('executing scripts')
- for script in conf['scripts']:
- ssh.execute(script, archive_name, log)
+ for i in conf:
+ log.info('starting virtual machine')
+ with contextlib.closing(_VM(i['vm'])) as vm:
+ log.info('creating SSH connection')
+ with contextlib.closing(_SSH(i['ssh'], vm.address)) as ssh:
+ log.info('transfering repository to virtual machine')
+ ssh.execute('rm -rf {} {}'.format(archive_file_name,
+ archive_name))
+ ssh.upload(archive_path, archive_file_name)
+ ssh.execute('mkdir {}'.format(archive_name))
+ ssh.execute('tar xf {} -C {}'.format(archive_file_name,
+ archive_name))
+ log.info('executing scripts')
+ for script in i['scripts']:
+ ssh.execute(script, archive_name, log)
t_end = time.monotonic()
log.info('executor finished (duration: {}s)'.format(t_end - t_begin))