1

I'm a newer to Qt project,strange to its project structure.

I have used jenkins+git+github+MSBuild+xUnit to build CI for VS project in windows.

Now my job is to configure jenkins so that it can auto build and test my qt project(in Ubuntu).

However,it seems there is few information about "jenkins build Qt project".

I don't know which plugins should I use on jenkins and how to configure them.

Can you show me how to do that?(I use 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

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?

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?)

zhiyong
  • 11
  • 1
  • 4

1 Answers1

-2

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?. That gives you Jenkins job execution (that at this point does nothing) after each git push automatically.
  • Pulling changes from SCM - that is a ready step within regular Jenkins project that you just click through.
  • 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.

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).

J_S
  • 2,985
  • 3
  • 15
  • 38
  • I still confuse why I use so many plugins in jenkins to build,test and pack Visual Studio project while just use a command in jenkins to finish build and test job.Do I miss some important step?And is there any command or plugin make jenkins help me pack my qt project in ubuntu? – zhiyong Mar 28 '18 at 11:44
  • You can just use a post-build step "Execute shell script" and pack your project (source files or result files) with a snigle bash command. – J_S Mar 28 '18 at 11:51
  • What bash command should I use?And what file will be create?(.deb file or what?) – zhiyong Mar 28 '18 at 12:18
  • I assume that by "packing" you mean creating an archive, which can be done using `zip -r foo.zip directory_path` – J_S Mar 28 '18 at 12:19
  • Creating a .deb file is not a function of Qt. It is an OS (i.e. Ubuntu) level function. Look at this [answer to "What is the simplest Debian Packaging Guide?"](https://askubuntu.com/a/1451) as a starting point. – jwernerny Mar 28 '18 at 13:56
  • This is a non-answer. The OP says "I have done this, please help me to do that". The answer explains how to achieve the steps that the user has already done and goes no to say "oh, yes and you can also do the additional thing that the OP has asked for help with". I have down-voted accordingly. – nurdglaw Oct 03 '18 at 10:05