def mirror_version(args): results = { 'created': {}, 'targets': {} } conf = fetch_config(args) j = JeerahClient(conf) j.connect() source_project = conf.modification.mirroring.source results['sources'] = [ strip_name(v.name) for v in j.versions(source_project) ] for target_project in conf.modification.mirroring.target: results['created'][target_project] = [] results['targets'][target_project] = [ v.name for v in j.versions(target_project) ] for i in results['sources']: if i not in results['targets'][target_project]: j.create_version(target_project, i, '', False) logger.info('created version named "{0}" in {1} project'.format(i, target_project)) results['created'][target_project].append(i) else: logger.info('project {0} exists. passing.'.format(i)) pprint(results)
def mirror_version(args): results = {'created': {}, 'targets': {}} conf = fetch_config(args) j = JeerahClient(conf) j.connect() source_project = conf.modification.mirroring.source results['sources'] = [ strip_name(v.name) for v in j.versions(source_project) ] for target_project in conf.modification.mirroring.target: results['created'][target_project] = [] results['targets'][target_project] = [ v.name for v in j.versions(target_project) ] for i in results['sources']: if i not in results['targets'][target_project]: j.create_version(target_project, i, '', False) logger.info( 'created version named "{0}" in {1} project'.format( i, target_project)) results['created'][target_project].append(i) else: logger.info('project {0} exists. passing.'.format(i)) pprint(results)
def release(args): results = {} conf = fetch_config(args) j = JeerahClient(conf) j.connect() for project in conf.site.projects: results[project] = [] current = j.versions(project) for version in conf.sprints.current: for v in current: if v.name in version: logger.debug('archiving {0} in project {1}'.format( v.name, project)) j.archive_version(v) j.release_version(v) results[project].append(v.name) else: logger.debug('{0} is not eligible for release'.format( v.name)) pprint({'released': results, 'code': 200})
def make_versions(args): conf = fetch_config(args) j = JeerahClient(conf) j.connect() if conf.runstate.project is None: conf.runstate.project = conf.modification.mirroring.source current_versions = [strip_name(v.name) for v in j.versions(conf.runstate.project)] created = [] v_not_exists_m = 'creating new version {0} in project {1}' v_exists_m = 'version {0} already exists in project {1}' for v in conf.sprints.get_sprint(conf.runstate.sprint).fix_versions: v = strip_name(v) if v not in current_versions: j.create_version(conf.runstate.project, v, release=False) created.append(v) logger.info(v_not_exists_m.format(v, conf.runstate.project)) else: logger.info(v_exists_m.format(v, conf.runstate.project)) pprint({'created': created, 'project': conf.runstate.project})
def make_versions(args): conf = fetch_config(args) j = JeerahClient(conf) j.connect() current_versions = [strip_name(v.name) for v in j.versions(conf.runstate.project)] created = [] for v in getattr(conf.sprints, conf.runstate.sprint): v = strip_name(v) if v not in current_versions: j.create_version(conf.runstate.project, v, release=False) created.append(v) logger.info('creating new version {0} in project {1}'.format(v, conf.runstate.project)) else: logger.info('version {0} already exists in project {1}'.format(v, conf.runstate.project)) pprint({ 'created': created, 'project': conf.runstate.project })
def release(args): results = { } conf = fetch_config(args) j = JeerahClient(conf) j.connect() for project in conf.site.projects: results[project] = [] current = j.versions(project) for version in conf.sprints.current: for v in current: if v.name in version: logger.debug('archiving {0} in project {1}'.format(v.name, project)) j.archive_version(v) j.release_version(v) results[project].append(v.name) else: logger.debug('{0} is not eligible for release'.format(v.name)) pprint({ 'released': results, 'code': 200 })
def make_versions(args): conf = fetch_config(args) j = JeerahClient(conf) j.connect() current_versions = [ strip_name(v.name) for v in j.versions(conf.runstate.project) ] created = [] for v in getattr(conf.sprints, conf.runstate.sprint): v = strip_name(v) if v not in current_versions: j.create_version(conf.runstate.project, v, release=False) created.append(v) logger.info('creating new version {0} in project {1}'.format( v, conf.runstate.project)) else: logger.info('version {0} already exists in project {1}'.format( v, conf.runstate.project)) pprint({'created': created, 'project': conf.runstate.project})