简体   繁体   English

为开发服务器设置GIT

[英]Setting up GIT for development server

Currently we have the following situation/problem: 当前,我们有以下情况/问题:

Our developers work local 我们的开发人员在本地工作

Developer pushes his changes to the repository on the git server ( all is fine up until now, because on GitLab I've set the ssh-key and the person can clone/pull/push ) 开发人员将所做的更改推送到 git服务器上的存储库中 (到目前为止,一切都很好,因为在GitLab上我已经设置了ssh-key,并且该人可以克隆/拉动/推送)

On the development server I need this to be pulled from git and here's where the issue start. 开发服务器上,我需要将其从git中拉出 ,这是问题开始的地方。

We have 1 development server , with >20 websites , so as I see it that's 20 users that I need to put in git seeing we plan on using it for all and create an ssh-key for each of those users seperatly , to be able to have the acces to pull the changes that were made to the repository) 我们有1个开发服务器 ,具有超过20个网站 ,因此我看到需要将20个用户放入git中,因为我们计划针对所有用户使用它,并分别为每个用户创建一个ssh密钥 ,以便具有访问权限以提取对存储库所做的更改

The above basically goes the same for our live server. 上面的内容对于我们的实时服务器基本相同。

I am at an loss how to approach this, is there a centralised way that I can simply give acces on server level to pull the changes? 我无所适从,如何解决这个问题,是否可以通过简单的方式在服务器级别授予访问权限来完成更改? I have been looking at it for about 1.5 months now, might be looking at it the wrong way. 我已经看了大约1.5个月,可能是看错了方向。

To add: We have around 14 servers running, so there's that. 要添加:我们大约有14台服务器正在运行,因此就可以了。

From: Gitlab SSH Readme 来自: Gitlab SSH自述文件

Deploy keys 部署密钥

Deploy keys allow read-only access to multiple projects with a single SSH key. 部署密钥允许使用单个SSH密钥对多个项目进行只读访问。

This is really useful for cloning repositories to your Continuous Integration (CI) server. 这对于将存储库克隆到持续集成(CI)服务器非常有用。 By using deploy keys, you don't have to setup a dummy user account. 通过使用部署密钥,您不必设置虚拟用户帐户。

If you are a project master or owner, you can add a deploy key in the project settings under the section 'Deploy Keys'. 如果您是项目主管或所有者,则可以在项目设置的“部署密钥”部分下添加部署密钥。 Press the 'New Deploy Key' button and upload a public SSH key. 按下“新部署密钥”按钮,然后上传公共SSH密钥。 After this, the machine that uses the corresponding private key has read-only access to the project. 此后,使用相应私钥的计算机对项目具有只读访问权限。

You can't add the same deploy key twice with the 'New Deploy Key' option. 您不能使用“新部署密钥”选项添加两次相同的部署密钥。 If you want to add the same key to another project, please enable it in the list that says 'Deploy keys from projects available to you'. 如果要将同一密钥添加到另一个项目,请在“从可用项目中部署密钥”列表中启用它。 All the deploy keys of all the projects you have access to are available. 您有权访问的所有项目的所有部署键均可用。 This project access can happen through being a direct member of the project, or through a group. 此项目访问可以通过成为项目的直接成员或通过组进行。 See def accessible_deploy_keys in app/models/user.rb for more information. 有关更多信息,请参阅app / models / user.rb中的def access_deploy_keys。

Deploy keys can be shared between projects, you just need to add them to each project. 部署密钥可以在项目之间共享,您只需将它们添加到每个项目中即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM