简体   繁体   English

如何配置我的詹金斯自动构建和测试我的Qt项目?

[英]How to configure my Jenkins to auto build and test my Qt project?

I'm a newer to Qt project,strange to its project structure. 我是Qt项目的新手,对其项目结构感到奇怪。

I have used jenkins+git+github+MSBuild+xUnit to build CI for VS project in windows. 我已经使用jenkins + git + github + MSBuild + xUnit在Windows中为VS项目构建CI。

Now my job is to configure jenkins so that it can auto build and test my qt project(in Ubuntu). 现在我的工作是配置jenkins,以便它可以自动构建和测试我的qt项目(在Ubuntu中)。

However,it seems there is few information about "jenkins build Qt project". 但是,似乎有关“詹金斯建立Qt项目”的信息很少。

I don't know which plugins should I use on jenkins and how to configure them. 我不知道我应该在jenkins上使用哪些插件,以及如何配置它们。

Can you show me how to do that?(I use Ubuntu 16.04) 你能告诉我怎么做吗(我使用Ubuntu 16.04)


I have read this blog,and try to run that way: https://www.peter.hartmann.tk/single-post/2015/06/17/Minimal-Continuous-Integration-for-Git-projects-with-Jenkins-and-a-Qt-example 我已阅读此博客,并尝试以这种方式运行: https : //www.peter.hartmann.tk/single-post/2015/06/17/Minimal-Continuous-Integration-for-Git-projects-with-Jenkins和一个Qt示例

In this blog,it use "qmake && make && make check" to do all the thing(build and test) without installing any plugin.what does this command do?Does it work for all Qt project? 在此博客中,它使用“ qmake && make && make check”执行所有操作(构建和测试),而无需安装任何插件。此命令的作用是什么?对所有Qt项目都有效吗?

What's more,in Ubuntu,can I pack my Qt project using jenkins?If yes,how to do that?(Windows can pack qt project as .exe file, Ubuntu pack as what kind of file?) 此外,在Ubuntu中,我可以使用jenkins打包我的Qt项目吗?如果是,该怎么做?(Windows可以将qt项目打包为.exe文件,而Ubuntu可以打包成什么样的文件?)

I'll just link to already existing materials, which there's plenty of. 我将链接到已经存在的大量材料。

In general there's three main steps in what you want to do: 通常,您要执行的操作分为三个主要步骤:

  • Trigger Jenkins build after git push: How can I make Jenkins CI with git trigger on pushes to master? 在git push之后触发Jenkins构建: 如何在推送到master时使用git trigger使Jenkins CI? . That gives you Jenkins job execution (that at this point does nothing) after each git push automatically. 这样,在每次git push自动执行后,您就可以执行Jenkins的作业执行(此时不执行任何操作)。
  • Pulling changes from SCM - that is a ready step within regular Jenkins project that you just click through. 从SCM中获取更改-这是您只需单击即可在常规Jenkins项目中准备好的步骤。
  • Building your project - in case of QT project which can be built from command line ( Compile a Qt project from command Line ) you can add this as a simple shell command build step in Jenkins. 构建项目-如果可以从命令行构建QT项目(从命令行编译Qt项目 ),则可以在Jenkins中将其添加为简单的shell命令构建步骤。

Optionally you can then run tests on the result, store your artifacts after a successful build and/or trigger email notifications on failed builds. (可选)然后,您可以对结果进行测试,在构建成功后存储工件,和/或在构建失败时触发电子邮件通知。

As for storing artifacts - there's a ready plugin for that ( https://wiki.jenkins.io/display/JENKINS/Compress+Artifacts+Plugin ). 至于存储工件-有一个准备好的插件( https://wiki.jenkins.io/display/JENKINS/Compress+Artifacts+Plugin )。

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

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