48 lines
1.4 KiB
Python
Executable File
48 lines
1.4 KiB
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import sys
|
|
import argparse
|
|
from armada.armada import Armada
|
|
from armada.logutil import LOG, setup_logging
|
|
|
|
DESCRIPTION = "Armada"
|
|
|
|
def parse_args():
|
|
|
|
ap = argparse.ArgumentParser(description=DESCRIPTION)
|
|
ap.add_argument('-c', '--config', action='store', required=True,
|
|
help='Path to YAML File or Directory')
|
|
ap.add_argument('--debug', action='store_true', default=False,
|
|
required=False, help='Enable debug logging')
|
|
ap.add_argument('--enable-chart-cleanup', action='store_true',
|
|
default=False, required=False, help='Clean up enviroment')
|
|
ap.add_argument('-d', '--dry-run', action='store_true', default=False,
|
|
required=False, help='Enable dry-run flag on all Tiller'
|
|
'Calls')
|
|
ap.add_argument('--disable-update-pre', action='store_true', default=False,
|
|
required=False, help='Disable pre update actions')
|
|
ap.add_argument('--disable-update-post', action='store_true',
|
|
default=False, required=False,
|
|
help='Disable post update actions')
|
|
|
|
return ap.parse_args()
|
|
|
|
|
|
def run(args):
|
|
|
|
armada = Armada(args)
|
|
armada.sync()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
args = parse_args()
|
|
setup_logging(args)
|
|
|
|
try:
|
|
run(args)
|
|
sys.exit(0)
|
|
except Exception as err:
|
|
LOG.exception(err)
|
|
sys.exit(1)
|