[英]Auto deployment with gitlab
We have Gitlab server running in our office in ubuntu server. 我们在ubuntu服务器上的办公室中运行着Gitlab服务器。 I'm doing auto deployment using post-receive hook from each repo.
我正在使用每个存储库中的后接收挂钩进行自动部署。 This is what I did,
这就是我所做的
GIT_WORK_TREE
and restart nginx server in same post-receive hook. GIT_WORK_TREE
,我编写了另一个接收后钩子,以使用GIT_WORK_TREE
部署代码,并在同一接收后钩子中重新启动nginx服务器。 Now I want to make this auto deployment through existing standard tools since with this way of deployment I need to configure all the repo so it will take lot of time again. 现在,我想通过现有的标准工具进行自动部署,因为通过这种部署方式,我需要配置所有存储库,因此将花费大量时间。 What are other ways to do this auto deployment.
还有哪些其他方式可以执行此自动部署。
Production Server : ubuntu 14.04LTS, Production Webserver : nginx, local git server : gitlab. 生产服务器 :ubuntu 14.04LTS, 生产网络服务器 :nginx, 本地git服务器 :gitlab。
UPDATE: I wanted to do this now because I had problem with gitlab shell as @Ciro Santilli explained. 更新:我现在想执行此操作,因为@Ciro Santilli解释了gitlab shell的问题。 And I'm also doing
git push production
as @Ciro Santilli answer's link mentioned after I had problem with gitlab shell. 在我对gitlab shell遇到问题之后,我也正在进行
git push production
作为@Ciro Santilli答案的链接。 But all I wanted to do is what Gitlab_CI does, push to master branch
our production server should be updated. 但是我要做的就是Gitlab_CI所做的,
push to master branch
生产服务器的push to master branch
应该更新。 I'll try with Gitlab_CI but I wanted to know is there any other tool to do the same. 我将尝试使用Gitlab_CI,但我想知道是否还有其他工具可以这样做。
EDIT: with the Custom Hooks feature , the old reasons given for not using hooks don't apply anymore if you have filesystem access. 编辑:具有“ 自定义挂钩”功能 ,如果您具有文件系统访问权限,则给出的不使用挂钩的旧原因也不再适用。 However, I'd still recommend using the CI because as it is:
但是,我仍然建议使用CI,因为它是:
.yaml
configuration inside the repository .yaml
配置时 Reasons for not using hooks before the Custom Hooks feature: 在“自定义挂钩”功能之前不使用挂钩的原因:
much as discussed at: Gitlab repository mirroring 讨论的更多内容: Gitlab存储库镜像
Unless you specify more about your deployment other than you want to do it with Git, there is nothing GitLab specific about it and the answers will be the same as for the generic Git problem: Deploy a project using Git push 除非您指定了其他部署以外的其他方法,否则您将不会对GitLab有所了解,答案将与通用Git问题相同: 使用Git push部署项目
If you have more specific requirements, there might be a service that does what you want: https://github.com/gitlabhq/gitlabhq/tree/d7c50b4a95b5530ae0e2f5249cfd9a419dd940c6/app/models/project_services , but I would leave that for another more specific question. 如果您有更具体的要求,则可能有一种服务可以满足您的需求: https : //github.com/gitlabhq/gitlabhq/tree/d7c50b4a95b5530ae0e2f5249cfd9a419dd940c6/app/models/project_services ,但我将其留给另一个更具体的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.