使用 gitosis 从存根自动创建存储库
使用 gitosis 配置存储库效果非常好。
然而,手动创建每个存储库非常麻烦,特别是因为它必须在命令行上完成。 (git init、git 远程添加、git 提交、git 推送) 由于我们的大多数项目都是 OSGi-Bundles,因此我们可以为每个项目使用几乎相同的存储库布局和 pom 文件。 因此,每次我们必须创建一个新包时,我不想创建所有这些,我想做这样的事情:
- 用户在 gitosis-admin 中配置存储库 [已经工作]
- 用户将更改推送到 gitosis [已经工作]
- gitosis 允许访问存储库[已经可以工作]
- gitosis 从存根创建一个存储库(包含 .gitignore、pom.xml、空 src/ 目录) [需要完成]
- 用户克隆存储库。 [已经工作]
- 用户将工作副本导入 eclipse [已经工作]
是否已经有解决方案/通用方法来解决步骤 4?我目前正在考虑使用 git-hook 来检测存储库配置。然而,似乎每次调用 post-update 时都可能需要解析 gitosis.conf 文件。
理想情况下,我想使用一些 git 信息来填充 pom.xml 文件(存储库名称作为artifactID,存储库描述作为工件描述等。)
是否有更方便/强大的方法来获取有关已配置但未配置的信息还创建了存储库吗?
Using gitosis to configure repositories works quite well.
However, manually creating every repository is quite cumbersome, especially as it has to be done on command line. (git init, git remote add, git commit, git push)
As the majority of our projects are OSGi-Bundles, we can use almost the same repository layout and pom-file for each project.
So instead of creating all this every time we have to create a new bundle i'd like to do something like this:
- User configures repository in gitosis-admin [works already]
- User pushes changes to gitosis [works already]
- gitosis enables access to repository [works already]
- gitosis creates a repository from a stub (containing .gitignore, pom.xml, empty src/ directory) [NEEDS TO BE DONE]
- User clones repository. [works already]
- User imports working copy into eclipse [works already]
Is there already a solution/common way to solve step 4? I'm currently thinking on using a git-hook to detect repository configuration. However, it seems that is may be necessary to parse the gitosis.conf file every time post-update is called.
Ideally, I'd like to use some git information to fill the pom.xml file (Repository-Name as artifactID, repository description as artifact description, etc..)
Is there a more convenient/robust way to get information about configured but not yet created repositories?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在某个地方创建一个如下所示的模板存储库:
然后您的新存储库的工作流程如下所示:
开发人员克隆模板存储库:
开发人员运行
setup-remote
脚本来配置对模板存储库的访问实际的远程存储库:
setup-remote 脚本负责:
这假定 Gitosis 已配置为开发人员可以推送到远程存储库。
You could create a template repository somewhere that looks like this:
Then your workflow for new repositories looks like this:
Developer clones the template repository:
Developer runs the
setup-remote
script to configure access to theactual remote repository:
And the setup-remote script takes care of:
This presumes that Gitosis has been configured such that the developer can push to the remote repository.