Vous êtes sur la page 1sur 8

Setup CI (Continuous Integration) build process Jenkins:

Prerequisite for Jenkins:


JDK6 or higher version, Maven (apache-maven-3.0.3) ,Curl(for windows curl-7.23.1-win64-ssl-sspi )

1. Download Jenkins for windows from the below link: http://jenkins-ci.org/changelog-stable 2. Inside the .zip folder two : Jenkins-1.515.msi Setup.exe

Double click setup.exe and install Jenkins in location like D:\Jenkins. 3. Service started with this, open localhost: 8080.

Configure Jenkins
A. Click Manage Jenkins , inside that click Configure System
B. Global properties: Set the Environment variables for Curl Path as below : name = PATH and value = <loc_of_curl> like name = PATH and value = C:\curl-7.23.1-win64ssl-sspi Apply and Save.

C. Set the name(anything) and path(where the software is installed) of JDK and Maven :

D. Set the path of Curl as below : Set the value of Shell executable as <path of curl> C:\curl-7.23.1-win64-ssl-sspi

Setup for new JOB


A. Click New Job; give job name (avoid space in the name). Select
maven2/3 project radio button and click ok. B. Inside the header Source Code Management Select Subversion radio button. In Modules give : Repository URL like https://del.sapient.resultspace.com/scm/sapient_hub/Codebase/Trunk Build a

After putting the SVN URL in the text field. Click the ? after the text field, inside that, click on the link written as click

this link and specify different

credential. Below is the snap shot for the same.

New window will open , provide the SVN URL and RS3 credentials and click OK.

Local module directory is optional give . Repository depth option :infinity Check-out Strategy: Use 'svn update' as much as possible. Repository browser : (Auto) Below is the snap shot for the same:

C.

Build : Root POM : pom.xml, Goals and options :blank Goals and options :

D.

clean install

Post Steps: select Run only if build succeeds(below is the snap shot for the same)

4. Copy the below commands and paste in the text area below the label Execute Windows batch Command

curl -u admin:"admin" -F name=sapient-ui.%BUILD_NUMBER% -F file="@D:\Jenkins\workspace\CI- Process\ui\target\sapient-ui.jar" http://localhost:4502/crx/packmgr/service.jsp curl -u admin:"admin" http://localhost:4502/crx/packmgr/service.jsp? cmd=inst^&name=sapient-ui.%BUILD_NUMBER% curl -u admin:"admin" -F name=sapient-ui.%BUILD_NUMBER% -F file="@D:\Jenkins\workspace\CI- Process\ui\target\sapient-ui.jar" http://10.209.4.202:4502/crx/packmgr/service.jsp curl -u admin:"admin" http://10.209.4.202:4502/crx/packmgr/service.jsp? cmd=inst^&name=sapient-ui.%BUILD_NUMBER% curl -u admin:"admin" -F name=sapient-ui.%BUILD_NUMBER% -F file="@D:\Jenkins\workspace\CI- Process\ui\target\sapient-ui.jar" http://54.235.192.163:4502/crx/packmgr/service.jsp curl -u admin:"admin" http://54.235.192.163:4502/crx/packmgr/service.jsp? cmd=inst^&name=sapient-ui.%BUILD_NUMBER%

Explaination of the above commands : BUILD_NUMBER we have as a predefined environment variable in jenkins. Uploading curl u <username>:<pwd> F name=<name of the new .zip folder that is build.[%BUILD_NUMBER%]> -F file = <Path of the .jar in target created> http://<ipaddress_of_the_envi_where _jar_needs_to _be_installed >/crx/packmgr/service.jsp Installing curl u <username>:<pwd>http://<ipaddress_of_the_envi_where_jar_needs_to_b e_installed>/crx/packmgr/service.jsp?cmd=inst^&name=< name of the new .zip folder that is build >.%BUILD_NUMBER% NOTE : Dont set any property in property.xml present at D:\Sape_Folder\sapient.comcode\Codebase\Trunk\ui\src\main\content\META-INF\vault\ properties.xml

How to Build

http://localhost:8080/view/All/ 1. Select Build Now option in the right dropdown present after the job name. 2. Check the log in Build History after the build time dropdown shows option like Console Output 3. Finished : SUCCESS

Vous aimerez peut-être aussi