将Jenkins与Gitlab集成 [英] Integrating Jenkins with Gitlab

查看:99
本文介绍了将Jenkins与Gitlab集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Jenkins中设置构建配置,以便每当触发构建时,我都会从Gitlab获取我的最新脚本,并将其复制到目标系统,然后在目标系统上运行该脚本.

I need to setup a build configuration in Jenkins so that whenever a build is triggered, I get my latest scripts from Gitlab and copy them to the target systems and run that script on the target.

我找不到将Gitlab集成到Jenkins的任何相关信息.我可以使用任何特定的插件吗?

I couldn't find any relevant info for integrating Gitlab to Jenkins. Are there any specific plugins that I could use?

我正在使用Jenkins 2.158版

I am using Jenkins version 2.158

推荐答案

Git存储库管理(github,gitlab,bitbucket等)和 Jenkins 之间的集成如下步骤:

Integration between Git Repository Management (github, gitlab,bitbucket, etc) and Jenkins has the following steps :

  • 开发人员将一些源代码(java,php,nodejs等)推送到Git存储库管理.
  • Git存储库管理检测到此事件,并在Jenkins中通知到某些公开 http端点.目前, webhook 是实施此通知的最推荐方法.
  • Jenkins接收到http发布请求(例如,从bitbucket发送),并使用一些插件或配置,Jenkins尝试确定或获取基本的devops参数,例如:分支名称,提交作者,提交消息,技术等
  • 在提取出的devops参数之后,Jenkins启动了一个预配置的作业.这项工作使用先前提取的值来构建,编译,压缩,安装或执行启动应用程序所需的任何事情.
  • Developer push some source code (java, php, nodejs, etc) to the Git Repository Management.
  • The Git Repository Management detects this event and notify to some public http endpoint in your Jenkins. Currently webhook is the most recommended way to implement this notification.
  • Jenkins receive the http post request(from bitbucket for example) and using some plugin or configurations , Jenkins try to determine or get the basic devops parameters like : branch name, commit author, commit message, technology, etc
  • Whit the extracted devops parameters, Jenkins launchs a preconfigured job. This job use the previously extracted values to build, compile, zip, install or to do whatever is necessary to startup your application.

如果您想实现此流程,请查看此帖子:

If you want to implement this flow, check this post:

https://jrichardsz.github.io /devops/devops-with-git-and-jenkins-using-webhooks

如果需要,也可以.我将很高兴地向您展示使用一些git仓库管理和jenkins的基本集成.请与我联系.

Also, if you need. I will gladly to show you a basic integration using some git repository management and jenkins . Just contact me.

这篇关于将Jenkins与Gitlab集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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