From ce0ad136aa32be34369fdf81221d2a4bc9096c2a Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Sat, 20 May 2023 18:01:13 +0200 Subject: [PATCH] Implement refresh argument Allows for re-provisioning of VM's. Signed-off-by: Georg Pfuetzenreuter --- scullery.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scullery.py b/scullery.py index bd0b483..925a8b1 100755 --- a/scullery.py +++ b/scullery.py @@ -30,6 +30,7 @@ argparser.add_argument('--suite', help='Specify the suite to run', required=True arggroup.add_argument('--stop', help='Stop running machines', action='store_true') arggroup.add_argument('--test', help='Start machines and run tests', action='store_true') arggroup.add_argument('--status', help='Get Vagrant deployment status', action='store_true') +arggroup.add_argument('--refresh', help='Re-sync files and re-run bootstrap scripts', action='store_true') args = argparser.parse_args() configfile = args.config @@ -134,7 +135,7 @@ def main_interactive(): log.info('Status report: {}'.format(v.status())) return True status = vagrant_isup(suite) - if status[0] is True and status[1] is None or args.stop: + if status[0] is True and status[1] is None or args.stop or args.refresh: if args.stop is True: log.info('Destroying machines ...') v.destroy() @@ -142,8 +143,11 @@ def main_interactive(): log.debug('OK') else: _abort('Destruction failed') - else: + elif not args.refresh: log.info('Deployment is already running') + elif args.refresh: + log.info('Deployment is running, initiating refresh ...') + v.provision() elif status[0] is False: if status[1] is True: log.debug('Deployment is not running')