How to use the kas.context.create_global_context function in kas

To help you get started, we’ve selected a few kas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github siemens / kas / kas / shell.py View on Github external
def run(self, args):
        """
            Runs this kas plugin
        """

        if args.cmd != 'shell':
            return False

        ctx = create_global_context(args)
        ctx.config = Config(args.config, None, None)

        macro = Macro()

        # Prepare
        if not args.keep_config_unchanged:
            macro.add(SetupDir())

        if 'SSH_PRIVATE_KEY' in os.environ:
            macro.add(SetupSSHAgent())

        ctx.keep_config = args.keep_config_unchanged

        macro.add(InitSetupRepos())

        repo_loop = Loop('repo_setup_loop')
github siemens / kas / kas / build.py View on Github external
def run(self, args):
        """
            Executes the build command of the kas plugin.
        """

        if args.cmd != 'build':
            return False

        ctx = create_global_context(args)
        ctx.config = Config(args.config, args.target, args.task)

        macro = Macro()

        # Prepare
        macro.add(SetupDir())

        if 'SSH_PRIVATE_KEY' in os.environ:
            macro.add(SetupSSHAgent())

        macro.add(InitSetupRepos())

        repo_loop = Loop('repo_setup_loop')
        repo_loop.add(SetupReposStep())

        macro.add(repo_loop)