在部署到詹金斯生产之前建立测试仓库
因此,我有一个服务的BDD测试项目,我想要的是,一旦我将分支合并到该服务的主分支中,则应首先触发BDD测试,如果每个测试案例都通过,则只能允许它将服务部署到生产中。 BDD用黄瓜java编写。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
因此,我有一个服务的BDD测试项目,我想要的是,一旦我将分支合并到该服务的主分支中,则应首先触发BDD测试,如果每个测试案例都通过,则只能允许它将服务部署到生产中。 BDD用黄瓜java编写。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
您需要在CI服务器(例如Jenkins)中进行配置。
您可以在设置Jenkins时考虑这些步骤以实现您的用例:
用git-hooks;一旦您将分支合并到主人,这将触发詹金斯管道。查看本文以获取更多信息 https://kohsuke.org/2011/12/01/polling-must-die-triggering-jenkins-builds-from-a-git-hook/
然后在詹金斯(Jenkins) BDD项目。这是一篇不错的文章,该文章解释了黄瓜项目的设置和在Jenkins中运行:
https://faun.pub/running-cucumber-tests-with-jenkins- A5A3A8DF07EB
当您的Cucumber项目通过时,然后在Jenkins中编写一个脚本以部署到生产中(这将是Jenkins的一个单独阶段)。尽管我建议您将其部署到登台服务器或 Artifactory ,它可以容纳您的发行程序包并有一个手动步骤来部署生产。
最后,这是一篇详细的文章,可以逐步说明如何将NocodeBDD与Jenkins集成。尽管本文适用于NocodeBDD,但您可以通过更改脚本的某些部分来复制这些步骤并将其应用于任何BDD项目。
You need to configure this in a CI server such as Jenkins.
You can consider these steps, when setting up Jenkins, to achieve your use case:
Use Git-hooks; This will trigger a Jenkins pipeline as soon you merge a branch into the master. Check this article for more info https://kohsuke.org/2011/12/01/polling-must-die-triggering-jenkins-builds-from-a-git-hook/
Then in Jenkins, run your BDD project. Here is a nice article, which explains how cucumber projects are setup and run in Jenkins:
https://faun.pub/running-cucumber-tests-with-jenkins-a5a3a8df07eb
When your cucumber project passes, then write a script in Jenkins to deploy into production (This would be a separate stage in Jenkins). Although I would recommend you to deploy this into a staging server or something like Artifactory, which would hold your release package and have a manual step to deploy into production.
Finally here is a detailed article that gives step by step explanation of how you could integrate NoCodeBDD with Jenkins. Though this article is for NoCodeBDD, you could copy these steps and apply them for any BDD project by changing some parts of the script.
https://blog.nocodebdd.com/integrate-nocodebdd-and-jenkins-to-run-bdd/