Wednesday, 31 December 2014

Git authentication for automation script


Git authentication


When you write some kind of automation (script) which needs to interact with git and clone/pull data and perform some action. And if its behind authentication layer then you need a way to automate the authentication that can let you pass credentials and automation can run without any interruption.

Either you can use ssh keys to authentication and use git@ URL to access your git repo.
But if you want to access (or force to) git via https URL you need to pass credential explicitly.
There are 2 ways to achieve this task for http protocol.


Friday, 5 December 2014

Logrotate setup


How to setup logrotate


There are several applications which do not have in build capability to rotate the logs and purge the old logs.
Lets take example of apache, You may need to rotate its log and purge old one and zip the current one. It's not possible to truncate the apache log when its running, You will need to handle in via logotate command.
Here is the way you can setup logrotate for an application.

Here I am taking example of apache, You can change it as per your need


Friday, 7 November 2014

Maven Findbugs error

Maven Findbugs error


When you update your java version from 1.7 to 1.8 and if you are using findbugs in your pom You may see following error while running the build.


[ERROR] Failed to execute goal org.codehaus.mojo:findbugs-maven-plugin:2.5.3:findbugs (findbugs) on project : Execution findbugs of goal org.codehaus.mojo:findbugs-maven-plugin::findbugs failed: Java returned: 1 -> [Help 1]

This is due to the mismatch of recent upgrade to java (1.8) and findbugs version.

You will have to upgrade (start using) FindBugs verion 3.0.0 and above. Any findbugs version below 3.0.0 will not work with java 1.8. 

Maven compiler error for invalid target java

Maven compiler error for invalid target java


Some time you may see following error during maven compilation 


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:compile (default-compile) on project metamarket: Fatal error compiling: invalid target release: 1.8 or 1.7 or 1.6 -> [Help 1]

This error is because, you system is set to use different version as default and source and target configuration is also set accordingly.

Friday, 31 October 2014

Jenkins Plugin Tips and Tricks - Part 1


In this section I will talk about Tips, Tricks, Troubleshooting of jenkins plugins.


Role strategy Plugin

This plugin adds a new role-based strategy to ease and fasten users management. You can even define pattern for the job and assign access for those jobs to users.

Tip - > While specifying the pattern add the "." before "*", Otherwise pattern will not work. Ex-

              test* will not match the job name which starts with test, You will need to add "." like test.* to match the job name starts with test.



Sunday, 14 September 2014

Jenkins slave is not showing any log


Some time Jenkins Slaves are neither showing any log nor getting connected and you may feel that its stuck somewhere.

Problem – The main problem could be the last connection was not cleaned up properly and its hung that is why nothing is shown in UI log.

Solution – Try to disconnect and kill the process in slave if any and then try to reconnect again .
Another option is that try to reconfigure slave with wrong config (say wrong port) are relaunch again, It will fail and cleanup connection, again configure back and relaunch, this should work.

Friday, 15 August 2014

Access Restriction for User in SVN


Controlling User access in Subversion


User can be restricted in SVN for the repo/branch etc via pre-commit scripts But that restriction will be only for check in (commit).
What if you want to restrict user from reading or checkout your repo/directory/branch. If you have some sensitive information in your repo(Or any other reason) which can only be accessed by set of users, Here is your solution to restrict read access to repo.

In your apache conf file you need to add following configuration.

   AuthzSVNAccessFile  /etc/apache2/conf/authz.conf


SVN Tag and Branch Lock


Locking SVN Tag


Every branch, tag is a directory in SVN. You have to(can) manipulate the directories as per your requirement. SVN does not provide any in built feature to lock any branch directory (branch, tag).

Here is the script to lock the tags in svn

#tag_lock.sh
#!/bin/sh

Saturday, 19 July 2014

Few Pre commit SVN scripts and tricks


SVN hook scripts

Today I would like to talk about some SVN pre-commit hooks scripts and customizations.
SVN comes with feature of precommit hook script which can be used to control commit and put tab on the basis of multiple requirements.
Here are few very common needed features in form of scripts.

Binary file check


Thursday, 15 May 2014

Build failing on sonar


With Maven 3+ we may face some issues while running sonar code coverage for the project in surefire plugin.
Looks line may be bug in maven or surefire, can't say right now.
Here is one of the weird error I have observed


Exception in thread "main" java.lang.NoClassDefFoundError: ${surefire/jvm/args}Caused by: java.lang.ClassNotFoundException: ${surefire.jvm.args} at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at

Monday, 7 April 2014

14 must have Jenkins plugins to increase productivity


Jenkins is vastly used continuous integration tool in current IT industry which is build and used around plugins. It has a core Jenkins tool and there are 100s of plug and play plugins available to enhance its power and usability.

Here let’s take a look few best jenkins plugins to increase the productivity.

  1. Global Build Stats Plugin It’s essential to know your current capacity, usage and capability before you go for capacity planning or system requirement because very first question is “what is your current capacity?”  

Monday, 3 February 2014

Continuous Delivery and Deployment

 

Continuous Delivery and Continuous deployment

This article talks about continuous Delivery  and Deployment to depict the picture of the reason and what exactly we need to look at before moving to CD.
Many times team may not have achieved the Continuous integration properly, may be due to lack to proper tool, workflow or historical process.

Below is the Presentation on same topic
http://www.slideshare.net/vishal_vsh1/continuous-delivery-41301166 

Saturday, 4 January 2014

Cluster/Partitioning of SVN Root

Partitioning of SVN Repository location 


There could be need in an organization to have subversion repositories for multiple business group or verticals, But at the same time they should be very well partitioned and should not look at each others repos. This means you need separate repo area for each business unit.

This can be done in 2 ways, either you can install separate SVN for each Business unit and handle the authentication according to their need OR you can use cluster management and