Esempio n. 1
0
    def run(self, config, args):
        envy = cloudenvy.envy.Envy(config)

        if not envy.server():
            logging.info('Triggering Envy boot.')
            try:
                envy.build_server()
            except exceptions.ImageNotFound:
                logging.error('Could not find image.')
                return
            except exceptions.NoIPsAvailable:
                logging.error('Could not find available IP.')
                return
        if not args.no_files:
            self.commands['files'].run(config, args)
        if not args.no_provision \
                and (envy.project_config.get("auto_provision", True)
                     and 'provision_scripts' in envy.project_config):
            try:
                self.commands['provision'].run(config, args)
            except SystemExit:
                raise SystemExit('You have not specified any provision '
                                 'scripts in your Envyfile. '
                                 'If you would like to run your Envy '
                                 'without a provision script; use the '
                                 '`--no-provision` command line flag.')
        if envy.ip():
            print envy.ip()
        else:
            logging.error('Could not determine IP.')
Esempio n. 2
0
    def run(self, config, args):
        envy = cloudenvy.envy.Envy(config)

        if not envy.server():
            logging.error('Envy is not running.')
        elif envy.ip():
            print envy.ip()
        else:
            logging.error('Could not determine IP.')