简体   繁体   English

CI与Maven,Git和Artifactory

[英]CI with Maven, Git and Artifactory

I want to create a CI pipeline using Maven, GitLab and Artifactory. 我想使用Maven,GitLab和Artifactory创建CI管道。

I already set up all these systems, and right now Jenkins makes a build, if a user pushes to GitLab and deploys the artifact to Artifactory. 我已经设置了所有这些系统,如果用户按下GitLab并将工件部署到Artifactory,Jenkins现在就进行构建。

But what I want is the following: 但是我想要的是以下内容:

The developer develops a Java application and can push his code to GitLab. 开发人员可以开发Java应用程序,并将其代码推送到GitLab。 At the point when he is finished he uses the maven-release-plugin and executes the release:prepare and release:perform goal. 完成时,他使用maven-release-plugin并执行release:prepare和release:perform目标。 The Maven release plugin automatically creates a new Tag and edits the version. Maven发行插件会自动创建一个新标签并编辑版本。 Now Jenkins should start a new job, build the artifact and deploy it to Artifactory. 现在,詹金斯应该开始一项新工作,构建工件并将其部署到Artifactory。

So the main thing I have to do is teaching Jenkins only to build Tags. 因此,我要做的主要是仅教Jenkins来构建标签。 Is there a way to do that? 有没有办法做到这一点?

I would recommend to activate the Maven release plugin with Jenkins and to build the release with a dedicated Jenkins job: 我建议使用Jenkins激活Maven发布插件,并使用专门的Jenkins作业构建发布:

在此处输入图片说明

在此处输入图片说明

This job will launch the prepare and perform goals, and will upload the release binary in Artifactory (via a dedicated post-build step). 该工作将启动准备和执行目标,并将二进制版本上载到Artifactory(通过专用的后期构建步骤)。

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

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