Jenkins and Xcode C++ Project Primer Tutorial

Jenkins and Xcode C++ Project Primer Tutorial

Jenkins and Xcode C++ Project Primer Tutorial

A scenario suiting today’s Jenkins is …

  • You’re a Jenkins web application and Xcode IDE C++ analyst/programmer creating a Mac OS X command line desktop application …
  • You’re responsible for coding, unit testing and sending updated desktop software to the remote Git repository …

    …for your project …
  • That remote Git repository for your project is accessible by all of your team, none of whom necessarily (but perhaps they also) change project code (nor even have to know of its existence, perhaps), in a variety of hosts with a similar Jenkins web application and Xcode environment installed …
  • Those Jenkins web applications are all polling the remote Git repository for changes to the software and automate a rebuild of an Xcode workspace copy to create a …

    …new Mac OS X executable

… which sounds to me like a good software automation scenario, with the checks and balances required to stop unauthorized practices, by involving that central remote Git repository, and the ssh security its writing to involves.

This is the power of Jenkins, and even though the C++ coding scenario we share with you today is very simple, and we use that simplicity with less generic settings than would be desired … as you can see from the Build -> Execute Shell -> Command …

if [ ! -d "TestRegardingJenkins" ]; then
mkdir TestRegardingJenkins
cp main.cpp TestRegardingJenkins
cp WebApplication.h TestRegardingJenkins

… this bears no relation to the flexibility of Jenkins to handle vastly more complex scenarios. Ring a bell? Yes, Ansible and Jenkins give you this feel of simplicity and scalability to your deployment solutions. And it is easy to see why we talk about them, because no one is going to give much time to a deployment solution that doesn’t work, nor probably to one that is too complex.

And so you can see that various IDEs can interface to Jenkins, as its design and methodologies are quite generic by nature. Yesterday we showed NetBeans IDE interface to Jenkins with our Jenkins and NetBeans Maven Project Primer Tutorial as shown below.

To read more about the Xcode and C++ project of today’s work, in isolation, before Jenkins interfacing, we based it on the code presented with Xcode C++ Web Applications Primer Tutorial.

We again recommend you acquire Jenkins: The Definitive Guide by John Ferguson Smart for great detailed information to get the most out of Jenkins, and you can see the slideshow of today’s work, as well.

Previous relevant Jenkins and NetBeans Maven Project Primer Tutorial is shown below.

Jenkins and NetBeans Maven Project Primer Tutorial

Jenkins and NetBeans Maven Project Primer Tutorial

Today we are installing Jenkins onto our MacBook Pro laptop. So what is Jenkins? Well, we quote from the Jenkins landing page below …

As an extensible automation server, Jenkins can be used as a simple CI server or turned into the continuous delivery hub for any project.

Jenkins is a self-contained Java-based program, ready to run out-of-the-box, with packages for Windows, Mac OS X and other Unix-like operating systems.

… and more explanation from Wikipedia …

Jenkins is an open source continuous integration tool written in Java. The project was forked from Hudson after a dispute with Oracle.

Jenkins provides continuous integration services for software development. It is a server-based system running in a servlet container such as Apache Tomcat. It supports SCM tools including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, Clearcase and RTC, and can execute Apache Ant and Apache Maven based projects as well as arbitrary shell scripts and Windows batch commands. The primary developer of Jenkins is Kohsuke Kawaguchi.[2] Released under the MIT License, Jenkins is free software.[3]

Builds can be started by various means, including being triggered by commit in a version control system, by scheduling via a cron-like mechanism, by building when other builds have completed, and by requesting a specific build URL.

… and via really useful link

Jenkins is an award-winning application that monitors executions of repeated jobs, such as building a software project or jobs run by cron.

… and we think it will be a great tool to use for software deployment purposes, as we start out learning about Jenkins today after the preparatory …

  • creating a Mac OS X new user “jenkins” in group “applications” for future use (that we talked about with Mac OS X Users and Groups Primer Tutorial
  • set up Git for a new remote Jenkins usage username rjmprogramming-com-au to interface to Jenkins (and/or NetBeans) later, including the creation of “jenkins” user ssh public and private keyfiles via ssh-keygen
  • installing Jenkins via its landing page with a first “warts ‘n all” “not quite there” earlier try at interfacing to a freestyle Xcode C++ project (which we’ll probably return to now that we know a lot more via the wonderful book Jenkins: The Definitive Guide by John Ferguson Smart that we highly recommend, and is almost solely the reason for some success below, and that we cannot hope to show as much detail as is there)

… and then …

  • consider interfacing Jenkins to a NetBeans IDE project we talked about with Netbeans Maven Java Web Application Primer Tutorial that used the NetBeans IDE and a GlassFish web server to create a Java web application …

    … whose Git source control we are presenting at our TicTacToe Nimh Git repository

    Did you know?

    Perhaps you noticed the use of HTTP://localhost:9190 for the Glassfish server today, inferring the use of port 9190, rather than the default 8080 port that is the default, but clashes with Jenkins’s default port 8080? How we got the two to live together was to change the web server HTTP port of Glassfish to be 9190, via, command …

    sudo vi /Applications/NetBeans/glassfish-4.1/glassfish/domains/domain1/config/domain.xml

    … and changing all (two) references to 8080 to be 9190.

  • so, armed with the incredible Jenkins: The Definitive Guide by John Ferguson Smart we follow lots of the advice there to present you with screenshots there that …
    1. set up Jenkins System Configuration …
    2. set up Jenkins Manage Plugins (for today) where all (and we mean all, unlike what the “warts ‘n all” link above may show) we asked for was the Git Plugin (and its dependencies flow on from that) …
    3. in Jenkins add a New Item which is a new Maven Project (interface) setup that will end up polling for changes at a crontab 1 minute interval …

      … for changes, and rebuild the Java web application via the brilliance of Maven by Apache
    4. … all the while getting ready for Git source control “friendliness”

We hope you like the resulting slideshow, as more food for thought, along with Ansible (we last talked about with Ansible Dynamic Inventory Tutorial), for some deployment and development tools of huge value.

If this was interesting you may be interested in this too.

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Software, Tutorials, Xcode and tagged , , , , , , , , , , , , , , , , . Bookmark the permalink.

One Response to Jenkins and Xcode C++ Project Primer Tutorial

  1. Research has shown that only 49% of businesses have a digital technique in place.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>