Showing posts with label jdk. Show all posts
Showing posts with label jdk. Show all posts

Friday, November 13, 2015

"Jenkins: The Definitive Guide" - Book Review

In this post I will express my thoughts on a book written for a specific but very useful tool called Jenkins CI. The book is called "Jenkins: The Definitive Guide"  written by John Ferguson Smart.
So what is Jenkins CI (Continuous Integration)? Jenkins is a tool created by Kohsuke Kawaguchi
and its main purpose is as stated to create environment for continuous integration of your software.

Jenkins is a Java based tool, a web aplication to be more specific. Runs on various operating systems and can be installed in various ways, from a system service to running it into Winstone , a servlet container tool. You can use Jenkins to automate building your software, generate documentation for it, run unit/integration/acceptance tests, publish test reports in HTML/PDF format and even upload files to remote server.
While building, errors can happen so good notification support in Jenkins is here to help you get notified when that happens. There is support for email/SMS/RSS/IRC/Instant Messaging notifications. Even special devices that blink red when build fails and green when succedes.
Jenkins has good support for build automation tools like Maven and Ant.
It has embeded support for SVN and support for Git/Mercurial and others trough plugins.
On the other hand, you can test network applications using distributed builds with JMeter and try various test environments using Multi-configuration builds.
You can run parametrized builds as well run code coverage and code quality tests.
There are ton of plugins built for specific cases and usage which you can easily download and use in your builds. You can also write your own Jenkins plugin.

Now something about the book.

 From the book preface:
"This book is aimed at relatively technical readers, though no prior experience with Continuous Integration is assumed. You may be new to Continuous Integration, and would like to learn about the benefits it can bring to your development team. Or, you might be using Jenkins or Hudson already, and want to discover how you can take your Continuous Integration infrastructure further.
Much of this book discusses Jenkins in the context of Java or JVM-related projects. Nevertheless, even if you are using another technology stack, this book should give you a good grounding in Continuous Integration with Jenkins. We discuss how to build projects using several non-Java technologies, including as Grails, Ruby on Rails and .NET. In addition, many topics, such as general configuration, notification, distributed builds and security are applicable no matter what language you are using."

Written in july/2011, in around 400 pages you will get hands on various parts of this powerful tool. My advice is to try and install Jenkins on your system and install or try things mentioned in the book. Various scenarious require various hardware and software so you will not have all the possibilites to try all of them. But at least you can download the plugins and check them shortly what they do. Some plugins are obsolete but I made a list of plugins I installed as test on my computer.
All in all the book gives a good grasp of all that might need you in your future project. Apart from some typos the book is a great read, and you should definitely spend some time with it. I give 4.5/5.It will be useful for year to come.

More about the chapters.
  1. Chapter 1: Introducing Jenkins. A short introduction what is and what it is used for. A short history how Jenkins came from Hudson. How to install and what is CI(Continuous Integration).
  2. Chapter 2:  Your first steps with Jenkins. Covers how to make working environment for Jenkins, installing JDK, Git, Github and Maven. Your first build job and running premade tests on it. Specificaly this project https://github.com/wakaleo/game-of-life. You will use some Jenkins plugins like Cobertura. I tried it and it is buggy. I recommend using Jacoco instead. Here are the plugins used in this chapter: Git plugin, GitHub plugin, Coberturra plugin,Jacoco plugin.
  3. Chapter 3: Installing Jenkins. Covers how to install, possible ways how to install o different OS systems. Jenkins home directory, memory considerations, java/maven/ant options etc... Upgrading, backing up jenkins etc...
  4. Chapter 4: Configurin your Jenkins server. Adding JDK/Maven/Ant installations. Configuring global properties, mail server, reverse proxy etc...
  5. Chapter 5: Setting up your build jobs. Covers types of builds, like free style job or mave build job. How to configure source code management tools like SVN and Git trough Git/GitHub plugins. Build triggers, polling the SCM, or calling a hook script to start the build process. Build steps, post build steps, and other useful plugins. Plugins mentioned:
    Gerrit Trigger plugin, Groovy, Gradle, Grails, Jython, MSBuild, Phing, Phyton, Rake, Ruby, Artifactory plugin, Nexus plugin, NUnit plugin, NAnt plugin
  6. Chapter 6: Automated Testing. Automatin Unit  and Acceptance tests. Configuring test reports, code coverage, automated preformance testing with JMeter. Plugins mentioned: Clover, NCover, Emma, HTML Publisher plugin, JMeter plugin, Performance plugin
  7. Chapter 7: Securing Jenkins. Activating security. Using simple security or security with LDAP server. Then using Active Directory or Unix users and groups. Atlassian Crowd commercial tool. Authorization, who can do what with matrix based security or with project based matrix security. There is even a tool for enabling Role based security with a plugin. Auditing, keeping track of user actions. Plugins mentioned: LDAP Plugin, Active Directory plugin, Crowd plugin, Role Strategy plugin, Audit Trail plugin, Job Configuration History plugin.
  8. Capter 8: Notification. Email notification, claiming builds, instant messaging or IRC messaging. Desktop notifiers like Notifo, mobile/SMS notification, making noise with extreme feedback devices. Plugins mentioned: Email Extension plugin, Instant Messaging plugin, Jabber notifier plugin.
  9. Chapter 9: Code Quality. Code quality in your build process. Code quality tools like  PMD/CPD, FindBugs, Checkstyle, CodeNarc. Reporting code quality problems with Violations plugin. Reporting with SonarQube. Plugins mentioned: Violations plugin, FindBugs, PMD/CPD, Checkstyle, JDepend, NCover, CodeNarc, Sonar Gerrit Plugin, SonarQube plugin
    Coverage Complexity Scatter plugin, Static Analysis Utilities plugin, Task Scanner plugin.
  10. Chapter 10: Advanced builds. Parametrized builds and parametrized triggers. Multi-configuration build jobs. Parallel builds and build pipelines. Plugins mentioned: Build Promotion plugin, Maven Release Plugin, Copy Artifact plugin, promoted builds plugin, ArtifactPromotion plugin, Build Pipeline plugin, Parametrized Trigger plugin, Maven Jenkins plugin, Dependency Graph Viewer plugin, Locks and Latches plugin.
  11. Chapter 11: Distributed builds. Master/Slave strategies. Associating builds to slaves. Node monitoring and cloud computing. Plugins mentioned: Amazon EC2 plugin, CloudBees Docker Build and Publish plugin.
  12. Chapter 12: Automated Deployment and Continous delivery. Deployment script, database updates, smoke tests. Deploying Java or PHP/Ruby application. Plugins mentioned: Capitomcat plugin.
  13. Chapter 13: Maintaining Jenkins. Monitoring disk space and server load. Backing up configuration and Jenkins builds. Archiving and migrating build jobs. Plugins mentioned: Disk Usage plugin, Backup plugin, ThinBackup plugin, Monitoring plugin, Deploy plugin, Deploy WebSphere
  14. Appendix: Automating your Unit and Integration Tests. Automating your tests with Maven and Ant. 
I hope this post is useful. Best regards. Vlado

Monday, July 18, 2011

Installing Netbeans 7 and JDK on Ubuntu

So we installed the needed software now we need a comprehensive IDE editor for developing php applications. I use Netbeans because it has support for PHP. 

You can also use Eclipse as an alternative by installing PHP plug-in. You can also use the adapted to PHP Eclipse version called Aptana. It has predefined PHP plug-in and also debuger. You can get it at this page aptana studio

Now before we install Netbeans or Eclipse we need jdk preinstalled on Ubuntu. jdk stands for Java Development Kit and is the needed environment for Netbeans/Eclipse since they are developed as Java applications.

So now go to this page java downloads. Since we are installing on Ubuntu download the second option with no RPM in it. The package with RPM is for Fedora and RedHat Linux distributions. You will download a bin file.

After the download run terminal and browse to the downloads folder of your system where you downloaded the bin file. 
Next, type this command:

$ chmod a+x jre-6u-linux-i586.bin

Now replace the with the version of the jdk you downloaded. This will make the file executable since it wasn't. If you get any error you also use this command:

$ chmod 777 jre-6u-linux-i586.bin

Now run this command

sudo ./jre-6u-linux-i586.bin

This will now install java development kit on your computer. After this finishes we are ready to install netbeans.

Note: Eclipse is a java base application it doesn't need to be installed like netbeans. Just download extract and you are ready to use it without installation.  You might wanna visit this page for eclipse eclipse downloads. Now it is preety much handy to create a shortcut to you desktop and also create menu item in you system menu(In other post).

Now we will install Netbeans 7.0 . Go to this page netbeans downloads and download the package that has dot in the php row. This package has preinstalled plug-ins for php, zend framework and also other stuff. No you will get an *.sh file. When download finishes open terminal and go to the downloads folder.

Run this command:

$ sudo chmod +x name_of_netbeans_file.sh

This will make it executable file. Now run this command 

$ sudo ./name_of_netbeans_file.sh

This will now install Netbeans on your system.

Note: For windows systems choose the windows option and download and install the ms installer for netbeans.

Wait a while and after the install is finished got to the system menu -> programming -> Netbeans IDE 7.0 This will start the IDE. We will create an empty test project with these commands:

File->New Project ->PHP Application.

In the Name and Location dialogue window place the name of project "HelloWorldPHP" and in the sources folder there must be /var/www/ in from of the HelloWorldPHP, so your location would be /var/www/HelloWorldPHP. In the next steps leave all fields default and click finsih.

That's it you created your first PHP application in the Netbeans IDE.

Before you work on this post see first ubuntu installation