def assets_setup(path, branch, repo): if os.path.exists(path): g = GitRepo(path) g.pull(branch=branch) logger.info('updated {0} repository'.format(path)) else: base, name = os.path.split(path) g = GitRepo(base) g.clone(repo, repo_path=name, branch=branch) logger.info('cloned {0} branch from repo {1}'.format(branch, repo))
def pin_tools(conf): if 'tools' in conf.system: if conf.system.tools.pinned is True: print('[bootstrap]: tool pinning engaged.') if 'ref' not in conf.system.tools or conf.system.tools.ref == 'HEAD': print('[bootstrap]: Cannot pin tools to HEAD, ' 'which is the default for non-pinned projects.') else: repo = GitRepo(path=conf.paths.buildsystem) if repo.sha() == conf.system.tools.ref: print('[bootstrap]: tools already pinned to {0}. ' 'Continuing without action.'.format(conf.system.tools.ref)) else: repo.checkout(conf.system.tools.ref) print("[bootstrap]: pinned tools repo to: {0}".format(conf.system.tools.ref)) else: print('[bootstrap]: tool pinning is not enabled.') else: print('[bootstrap]: tool pinning is not supported by this project.')
def pin_tools(conf): if 'tools' in conf.system: if conf.system.tools.pinned is True: logger.info('tool pinning engaged.') if 'ref' not in conf.system.tools or conf.system.tools.ref == 'HEAD': logger.warning('Cannot pin tools to HEAD, ' 'which is the default for non-pinned projects.') else: repo = GitRepo(path=conf.paths.buildsystem) if repo.sha() == conf.system.tools.ref: logger.warning('tools already pinned to {0}. ' 'Continuing without action.'.format( conf.system.tools.ref)) else: repo.checkout(conf.system.tools.ref) logger.info("pinned tools repo to: {0}".format( conf.system.tools.ref)) else: logger.info('tool pinning is not enabled.') else: logger.warning('tool pinning is not supported by this project.')