管理代码库池的库和工具
repoman-scm的Python项目详细描述
repoman是一个python库,旨在自动化存储库操作 在发布过程中。
它提供了一个统一的api来处理不同的scm,并且 快速准备和清理工作副本的机制。目前 支持Git和Mercurial。
有一些基本概念需要开始使用 报告人:
- Repository是具有通常的scm操作的实例。
- Depot包含一个存储库,以及用于交互的操作 与repoman经理。
- 一个DepotManager为Depots提供一个特定的代码,每个 DepotManager用于管理相同的Depots。 项目
- 每个Depot被锁定到向管理器请求它的任务 属于这个任务直到它被释放。
但最好的方法是用一个例子来说明它的工作原理:
fromrepomanimportdepot_managerrepo_kind='git'repo_url='https://github.com/tuenti/python-repoman.git'manager=depot_manager.DepotManager(repo_kind=repo_kind)depot=manager.give_me_depot('task_id','Owner task name')try:depot.request_refresh({repo_url:['master']})# Do work...depot.repository.tag('example')# ...# If you were going to continue the task in other process,# it needs to receive the path of the depot to request itdepot=manager.give_me_depot_from_path(depot.path)assert'example'indepot.repository.tags()finally:# And when the repository is not needed anymore, free its depotmanager.free_depot(depot,'task_id')
通过查看^{tt8}中的示例,您可以了解更多$ 目录,并以完整的API reference。
安装
repoman旨在用作更复杂的版本的一部分 自动化基础设施,它需要一套相当具体的 依赖项,请参阅Requirements一节了解更多信息。
要在开发环境中安装它,可以使用pip:
pip install -e git+https://github.com/tuenti/python-repoman.git@v0.6#egg=repoman
要在生产环境中安装它,建议 生成您自己的软件包,通常的工具可用于此目的,例如:
python setup.py bdist_egg
要求
repoman应该能够很好地使用python>;2.6的任何linux发行版, 它每天都在debian中使用,并且在ubuntu和 软呢帽。
一般来说,pip install -r requirements.txt能够 安装所有东西,但有些东西需要考虑。
pygit2需要编译,因此需要gcc工具链 以及libgit2的开发文件(请参见pygit2 installation notes)。 您必须使用相同版本的pygit2和libgit2。目前 repoman仅适用于0.20系列。建议你自己准备 为您的生产环境预先构建的软件包集。
mercurial>;2.1以及python-hglib也是必需的。 在requirements.txt文件中指定的版本应该可以。
在docker目录中提供了一些dockerfile文件,它们可以提供 关于如何准备与repoman一起工作的环境的示例 不同的分布。
信用卡和联系人
repoman是由Tuenti Technologies S.L.创建的。你可以跟着 twitter上的tuenti工程团队。
许可证
repoman在apache许可证2.0版下可用。见许可证 文件以获取更多信息。