Posts

Showing posts from January, 2018

Gradle Tutorial

Gradle is an open source, advanced general purpose build management system. It is built on ANT, Maven, and lvy repositories. It supports Groovy based Domain Specific Language (DSL) over XML. This tutorial explains how you can use Gradle as a build automation tool for Java as well as Groovy projects. Prerequisites Gradle is a Groovy-based build automation tool. So, it will certainly help if you have some prior exposure to Groovy. In addition, you should have working knowledge of Java. JDK and Groovy are the prerequisites for Gradle installation. Gradle requires JDK version 6 or later to be installed in your system. It uses the JDK libraries which is installed and sets to the JAVA_HOME environmental variable. Gradle carries its own Groovy library, therefore, we do no need to install Groovy explicitly. If it is installed, that is ignored by Gradle. Following are the steps to install Gradle in your system. Step 1 − Verify JAVA Installation First of all, you need to ha

How to Upgrade the Jenkins version to latest

Jenkins Upgrade in Ubuntu: shutdown the jenkins ( goto —> Manage Jenkins —> Prepare for shutdown ) Take a snapshot of the ubuntu (AWS) image Login to the Jenkins (Master) Server Run the below commands $ service jenkins stop / service jenkins stop $ apt-get update / yum update -y $ apt-get install jenkins / service jenkins start $ service jenkins start — Go into Jenkins server Jenkins > Manage Plugins > Select "All" Click "Download now and install after restart" Notable Locations (Config, Logs) Config (config.xml): /var/lib/jenkins Logs: /var/log/jenkins

Jenkins Tips !!

Tip - 1 To Delete the Builds from Jenkins from N1 to Nn ( For ex- from build4 to build20) Go to Manage Jenkins --> Script Console and use the below command. Jenkins.instance.getItemByFullName('JobName').builds.findAll { it.number >  && it.number < 1717 }.each { it.delete()  } For example:- Jenkins.instance.getItemByFullName('TestJen').builds.findAll { it.number > 10 && it.number < 38 }.each { it.delete() } Tip - 2 To modify the next build number in Jenkins. Jenkins.instance.getItemByFullName("My-Build-Pipeline/feature-improve-build").updateNextBuildNumber(47) For example:- Jenkins.instance.getItemByFullName("Organisation/Repository/Branch").updateNextBuildNumber(47) Tip - 3 To modify the next build number in Jenkins (Another Way of doing) You can run the following from the  Script Console  (  $JENKINS_URL/script ): def jo