def upload(snap_filename): if not os.path.exists(snap_filename): raise FileNotFoundError(snap_filename) else: snap_name = _get_name_from_snap_file(snap_filename) logger.info("Uploading existing {}.".format(snap_filename)) config = load_config() storeapi.upload(snap_filename, snap_name, config=config)
def upload(snap_filename): if not os.path.exists(snap_filename): raise FileNotFoundError(snap_filename) else: snap_name = _get_name_from_snap_file(snap_filename) logger.info('Uploading existing {}.'.format(snap_filename)) config = load_config() storeapi.upload(snap_filename, snap_name, config=config)
def main(argv=None): """Upload snap package to the Ubuntu Store.""" argv = argv if argv else [] docopt(__doc__, argv=argv) # make sure the full lifecycle is executed yaml_config = snapcraft.yaml.load_config() snap_filename = format_snap_name(yaml_config.data) if not os.path.exists(snap_filename): logger.info( 'Snap {} not found. Running snap step to create it.'.format( snap_filename)) snap.main(argv=argv) config = load_config() upload(snap_filename, yaml_config.data['name'], config=config)
def main(argv=None): """Upload snap package to the Ubuntu Store.""" argv = argv if argv else [] docopt(__doc__, argv=argv) # make sure the full lifecycle is executed yaml_config = snapcraft.yaml.load_config() snap_name = _format_snap_name(yaml_config.data) if not os.path.exists(snap_name): logger.info( 'Snap {} not found. Running snap step to create it.'.format( snap_name)) snap.main(argv=argv) logger.info('Uploading {}'.format(snap_name)) config = load_config() success = upload(snap_name, config=config) if success: logger.info('{} upload complete'.format(snap_name)) else: logger.info('{} upload failed'.format(snap_name))