简体   繁体   English

Jenkins-合并母版时在Docker映像中更新Github项目存储库

[英]Jenkins - Update Github project repo inside Docker image when merging master

I'm making integration test repo which stays inside the Docker image running on the AWS instance. 我正在制作集成测试存储库,该存储库位于AWS实例上运行的Docker映像内。 Actually, whenever i wanna update the integration test scripts from GitHub to AWS instance, i need to ssh manually to instance then type the command git pull to get the latest code from GitHub repo contains the test scripts. 实际上,每当我想将集成测试脚本从GitHub更新到AWS实例时,我都需要手动ssh进行实例化,然后键入命令git pull以从GitHub存储库中获取包含测试脚本的最新代码。 My intention is whenever there's a merge action in GitHub repo (master branch) , i want Jenkins to automatically update it to the integration test repo in my AWS instance, so that the testing won't be obsoleted somehow (in holidays and no one in charges for update the scripts). 我的意图是,每当GitHub repo(主分支)中发生merge操作时,我希望Jenkins将其自动更新到我的AWS实例中的集成测试仓库中,以使测试不会以某种方式被废弃(在假期中,任何人都不会这样做)。脚本更新费用)。

So, could anyone give me recommendation and idea to make it ? 那么,有人可以给我推荐和想法吗?

Thanks a lot 非常感谢

What do you think about cron on the docker container? 您如何看待docker容器上的cron? Inside that cron command you'd git fetch remote repository and check if there are any changes that should be applied. 在该cron命令中,您可以git fetch远程存储库,并检查是否应应用任何更改。 If so the same cron command could perform git pull . 如果是这样,则相同的cron命令可以执行git pull

That'd require to write some script that's going to be executed in crontab. 这需要编写一些脚本,该脚本将在crontab中执行。 Please also remember about monitoring it somehow - cron that's not monitored does not execute ;). 还请记住以某种方式监视它-未监视的cron不会执行;)。

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

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