将Git Repo直接镜像到AWS CodeCommit [英] Mirror a Git Repo directly to AWS CodeCommit

查看:265
本文介绍了将Git Repo直接镜像到AWS CodeCommit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的Git存储库创建一个备份并将其保存到AWS CodeCommit。我不想包括使用我的本地机器。任何人都可以告诉我如何直接或通过AWS Lambda来做到这一点?

我刚开始寻找这个答案题。在发布我的一些初步数据之前,您是否找到了解决方案?

以下是我迄今发现的内容:不幸的是,没有'声誉'来发布我找到的所有链接,所以我修改了帖子,以便它不显示为链接:-(


  1. 我发现了其他解决方案的一些有趣帖子:
    BitBucket - > https://github.com/ef-labs/stash-hook-mirror

GitHub - >此开放票https://github.com/gitbucket/gitbucket/issues/833
- > https://help.github.com/articles/about-webhooks /



JGit - > https://fancybeans.com/2012/08/24/how-to-use-s3-as-a-private-git-repository /



Gitlab - > https://stackoverflow.com/questions/21962872/how-to-create-a-gitlab-webhook-to-update-a-mirror -repo-on-github(具体是此处
我已成功使用镜像功能自动请使用GitLab.com提供的镜像功能将GitHub存储库拉入GitLab中。



我还发现 https://github.com/lambci/lambci 这是无服务器的CI,看起来很有希望。



我相信答案在于WebSooks(GitLab和其他人)的AWS SNS主题监控的组合,并将响应传递给Lambda,这会激发一个具有git或jgit来运行命令的实例(请参阅LambCI Repository以了解详细信息。) p>

此解决方案的唯一问题是AWS Lambda实例会将镜像存储库克隆到其本地存储,然后推送到AWS Code Commit,并且每次实例时都会重复此操作所以对于大型版本库或VERY ACTIVE版本库来说,这可能不是一个好主意,您最好使用CRON作业启动nano EC2实例,以将资源库镜像到AWS Code Commit。


I want to create a backup of one fo my Git Repository and save it to AWS CodeCommit. I don't want to include the use of my local machine. Can anyone tell me how can I do it directly or through AWS Lambda?

解决方案

I just started searching for the answer to this very question. Before I post some of my preliminary data have you found a solution to this?

Here is what I have found so far: I unfortunately do not have the 'reputation' to post all the links that I found so I modified the post so it does not show as a link :-(

  1. I found some interesting posts for other solutions: BitBucket -> https: //github.com/ef-labs/stash-hook-mirror

GitHub -> This open ticket https: //github.com/gitbucket/gitbucket/issues/833 -> https: //help.github.com/articles/about-webhooks/

JGit -> https: //fancybeans.com/2012/08/24/how-to-use-s3-as-a-private-git-repository/

Gitlab -> https: //stackoverflow.com/questions/21962872/how-to-create-a-gitlab-webhook-to-update-a-mirror-repo-on-github (Specifically the part here) I have successfully used the mirror feature to automatically pull a GitHub Repository into GitLab using the mirror feature offered by GitLab.com.

I also found https://github.com/lambci/lambci which is serverless CI and looks promising.

I believe the answer lies in a combination of AWS SNS Topic monitoring of Webhooks (GitLab and others) and pass the response to Lambda which spins up an instance which has either git or jgit to run the command (look through the LambCI Repository for details.)

The only problem with this solution is that the AWS Lambda instance will clone the mirrored repository to it's local storage and then push to AWS Code Commit and this will be repeated each time an instance gets started so for LARGE repositories or VERY ACTIVE repositories this may not be a good idea and you would be better off spinning up a nano EC2 instance with a CRON job to mirror the repository to AWS Code Commit.

这篇关于将Git Repo直接镜像到AWS CodeCommit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆