Jenkins - Baby steps

39 views
Skip to first unread message

Kumara Raja S

unread,
Jan 14, 2015, 8:46:23 AM1/14/15
to jenkins...@googlegroups.com
Hello!

Am quite new to Jenkins.

I can say, I have been using Jenkins for couple years. But never got a chance to set up  the Jenkins environment.

So, am new to setting up Jenkins.

I am have C++ projects in my SVN server.

I could link those projects in Jenkins.

But, the build step becoming nightmare for me.

I have installed MinGW in my Windows machine.

But, am not able to build the project, it always fails.

I would like to know step by step to build the C++ project using Jenkins.

Please help me out.

Thank you,
Kumara

David Aldrich

unread,
Jan 14, 2015, 8:50:01 AM1/14/15
to jenkins...@googlegroups.com

Which environment are you targeting?  (I guess you are targeting Linux with the gcc compiler).

Message has been deleted

Kumara Raja S

unread,
Jan 16, 2015, 5:26:30 AM1/16/15
to jenkins...@googlegroups.com, david....@emea.nec.com
Hi David,

Sorry for the delayed reply.

Here is my further analysis.

I want to integrate a simple "c" project. This project will be built using gcc. As you mentioned targetting Linux platform.

But the Jenkins will be running in windows machine, reason is that, Jenkins need to build the windows based application as well.

Further to this, I understood that, I need to have "gcc" compiler in windows machine to build the application.

So, I have installed MinGW. But, still am not able to link the project successfully.

Rob Mandeville

unread,
Jan 16, 2015, 8:35:38 AM1/16/15
to jenkins...@googlegroups.com, Rob Mandeville

The beauty of Jenkins is that a single installation can run on multiple hosts.  That’s what slave nodes are for.  Rather than cross-compiling, just put together a Linux machine with GCC, and build your Linux binaries there.  Here’s what you do.

 

First off, I’m assuming that you have a job like “Build windows binary”.  Configure that job, and check the “Restrict where this project can be run” box so that it runs on “master”.  This forces it to run on the Jenkins server itself; since your Jenkins server runs in Windows, this forces this job to run on a Windows machine.

 

In your Linux compiler box, create an account for Jenkins (maybe name it ‘jenkins’).  In its home directory, make a directory called “linux1”.

 

Go to Jenkins->Manage Jenkins->Manage Nodes->New Node.  Create a new “dumb slave” node called “linux1”.

 

 

Set up “linux1” to use the launch method of “Launch slave agents on Unix machines via SSH”.  Give it the credentials to log in to your Linux compiler box.  as a non-root user with access to the compiler.  Set the Remote FS to the directory you set up (likely /home/jenkins/linux1).  Give it a label of “linux”.  After configuring it, make sure that it launches.

 

If you go to the main Jenkins page, you will now see “linux1” on the left, under the build queue.

 

Create a new job, called “Build Linux binary”, as a copy of the “Build windows binary” job.  Change the “Restrict where this project can be run” to run on label “linux”.  Replace all “Execute Windows batch command” steps with the appropriate “Execute shell” steps—while all new steps are created at the end of the list, you can drag steps into place by dragging the little 4x4 grid at the top left of a given step.  Make whatever other changes are necessary to make this job appropriate to your Linux machine.

 

With all this set up, your new job will run on the Linux host you set up, and you can still see everything from the Jenkins server.

 

--Rob

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/39ed8162-8990-42a5-8ef5-3fefa5f412ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Click here to report this email as spam.



This e-mail and the information, including any attachments it contains, are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.

Mark Waite

unread,
Jan 16, 2015, 8:52:06 AM1/16/15
to jenkins...@googlegroups.com
On Fri, Jan 16, 2015 at 6:35 AM, Rob Mandeville <rmand...@dekaresearch.com> wrote:

The beauty of Jenkins is that a single installation can run on multiple hosts.  That’s what slave nodes are for.  Rather than cross-compiling, just put together a Linux machine with GCC, and build your Linux binaries there.  Here’s what you do.

 

First off, I’m assuming that you have a job like “Build windows binary”.  Configure that job, and check the “Restrict where this project can be run” box so that it runs on “master”.  This forces it to run on the Jenkins server itself; since your Jenkins server runs in Windows, this forces this job to run on a Windows machine. 


That's the type of setup I use, and it works very well.  

I've also liked using the Platform Labeler plugin so that labels are automatically assigned to the slave for operating system name, operating system version, and chip architecture.  I also found a case where the Implied Labels plugin was a great help.
 
Mark Waite
Reply all
Reply to author
Forward
0 new messages