[英]AWS CodeDeploy integration with GitLab
I have set up two EC2 instances in a private subnet behind a NAT. 我已经在NAT后面的专用子网中设置了两个EC2实例。 The instances are both in a AutoScalling group. 这些实例都在一个AutoScalling组中。 I want to integrate CodeDeploy with my repository from GitLab. 我想将CodeDeploy与来自GitLab的存储库集成。
All I can think of now is running a script on the BeforeInstall hook of the appspec.yml file. 我现在能想到的就是在appspec.yml文件的BeforeInstall挂钩上运行脚本。
Is there another way to do this? 还有另一种方法吗?
GitLab doesn't implements a direct integration with AWS services, but you can work around that. GitLab不会与AWS服务实现直接集成,但是您可以解决此问题。 You can do something like what you described, and implement all the installation/distribution/auth logic, but then you aren't really getting much from CodeDeploy. 您可以执行您所描述的操作,并实现所有的安装/分发/身份验证逻辑,但是从CodeDeploy中获得的好处并不多。 What you should do depends on what you are trying to achieve. 您应该做什么取决于您要实现的目标。
Automatic deployment on push : You can get automatic deployments on commit to GitLab if you bridge their WebHooks with something that can authenticate to AWS. 推送时自动部署 :如果您将WebHooks与可以向AWS进行身份验证的内容联系起来,则可以在提交到GitLab时进行自动部署。 That might look like: 可能看起来像:
If you want to have manual deployments, you could do the same as above but manually trigger the Jenkins build. 如果您要进行手动部署,则可以执行与上述相同的操作,但是手动触发Jenkins构建。
Deploy manually only : Do the following when you want to deploy: 仅手动部署:要部署时,请执行以下操作:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.