Top Banner
SOLUTION AND PLATFORM OF PAYMENT CONTINUOUS INTEGRATION WITH HUDSON ISSUE: 1.0 DATE: 15/09/2010 Continuous Integration with Hudson Usage Guide. © Atos Worldline Ò Worldline is a registered trademark. All rights, including in respect of the translation, printing and duplication of this document of parts thereof, are retained. No part of this document may be reproduced or processes with or without electronic means, in any form, without the prior written permission of Atos Worldline. This includes for training purposes. Document Information Title Continuous Integration with Hudson Usage Guide Topic Continuous Integration with Hudson Usage Guide Name of file Continuous Integration Usage Guideline.doc Number of pages 22 ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 1 / 31 An Atos Origin Company
31
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

Continuous Integration with Hudson Usage Guide.

© Atos Worldline

Ò Worldline is a registered trademark.

All rights, including in respect of the translation, printing and duplication of this document of parts thereof, are retained. No part of this document may be reproduced or processes with or without electronic means, in any form, without the prior written permission of Atos Worldline. This includes for training purposes.

Document InformationTitle Continuous Integration with Hudson Usage GuideTopic Continuous Integration with Hudson Usage Guide

Name of file Continuous Integration Usage Guideline.docNumber of pages 22

VersionDate 16/09/2010Status Draft versionConfidentiality Confidential

Contact Person Mustafa Kanchwala

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 1 / 23

An Atos Origin Company

Page 2: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

1)Introduction

Continuous integration is a process in which all development work is integrated at a predefined time or event and the resulting works is automatically tested and build. The idea is that development errors are identified very early in the process.

Hudson is one open source tool to perform Continuous Integration. The basic functionality of Hudson is to monitor a SCM (Source Control System) and if changes occurs to start and monitor a build system (for example Apache Ant or Maven). Hudson will monitor the whole process and provide reporting functionality and notification functionality to report success or errors.

Hudson can be extended by additional plugins. An installation exists in Seclin and can be accessed via http://wlp.priv.atos.fr:8080/hudson/. Currently the server is used to build project artifacts and transfer them to the Nexus maven repository.

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 2 / 23

An Atos Origin Company

Page 3: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

2) Access 1) Access Url http://wlp.priv.atos.fr:8080/hudson/ you will be redirected to Home Page of Hudson2) Click on log in link

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 3 / 23

An Atos Origin Company

Page 4: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

1) Enter DASID and DAS Password. You need the corresponding rights in order to manage jobs. Ask TPM for the rights

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 4 / 23

An Atos Origin Company

Page 5: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

3)Creation

Steps for New Job Creation

1) Hudson dashboard is displayed on successful login Go to Sonar Section/Tab

2) The command "New Job" is available through the "My Views" menu entry in the left banner.

3) Click on <<New Job>> link. Below screen will be displayed.

4) Enter New job Name in the Job Name Textfield. Enter Build wlp-cc as job name

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 5 / 23

An Atos Origin Company

Page 6: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

5) Select option « Copy existing job» Input the project name from which you want to make the copy (ex : build wlp-cc-commonobjetcs 3.1). Click “Ok.

6) For naming consistency, use the following pattern as job name: “build” + artifactId of root project.

7) Once you created a job in this way, it is effectively identical to the job you copied except for the job name. So you need to modify the configuration items, for this first navigate the Configure page on the newly created job and add your properties over and save it.

8) After creation, move to Configuration dashboard of this job and add your properties here and save it.

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 6 / 23

An Atos Origin Company

Page 7: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

4)Build

The objective of the "Build" job is to synchronize the workspace source with CVS, update the dependencies, build the projects, run the attached tests and transfer the tested artifacts to a local repository on the host platform.

The definition and configuration of a Hudson build job should be handled by the Hudson administrator together with the delivery manager of the project.

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 7 / 23

An Atos Origin Company

Page 8: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

5)Configuration

1) Define the name of the job and description. Please note that all build jobs should be called Build <project name> [snapshot|release], e.g. Build wlp-cc (Sonar). We should not create release specific build jobs like Build wlp-cc v2.0. A release should only be built and deployed once. The deployment system will not overwrite an existing artifact in the Nexus repository.

2) Enter/Select the options as displayed in the below screen.

3) Add the CVS details as shown below

a) The current modules source codes are available on the head of the project.

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 8 / 23

An Atos Origin Company

Page 9: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

b) If the Source code is available in the branch then enter branch name in the Branch Text field

c) If it is available as tagged sources click on the checkbox “This is a Tag, not a branch”

4) You can schedule your project build by selecting “Build periodically” check box.

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 9 / 23

An Atos Origin Company

Page 10: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

You need to give scheduling time in Schedule text area .Each line consists of 5 fields separated by TAB or whitespace.

In our example we used field values as “30 2 * * 2,3,4,5,6”

Meaning of above value is that build will start on each day from Tuesday to Saturday at 2:30 AM CET or 6:00 AM IST.

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 10 / 23

An Atos Origin Company

MINUTE HOUR DOM MONTH DOW

MINUTE Minutes within the hour (0-59)HOUR The hour of the day (0-23)DOM The day of the month (1-31)MONTH The month (1-12)DOW The day of the week (0-7) where 0 and 7 are Sunday.

To specify multiple values for one field, the following operators are available. In the order of precedence,

'*' can be used to specify all valid values. 'M-N' can be used to specify a range, such as "1-5"

'M-N/X' or '*/X' can be used to specify skips of X's value through the range, such as "*/15" in the MINUTE field for "0,15,30,45" and "1-6/2" for "1,3,5"

'A,B,...,Z' can be used to specify multiple values, such as "0,30" or "1,3,5"

Empty lines and lines that start with '#' will be ignored as comments.

In addition, '@yearly', '@annually', '@monthly', '@weekly', '@daily', '@midnight', and '@hourly' are supported.

Page 11: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

5) Specify the project pom file and the maven goals that should be run. The path to the pom.xml file starts at the level of the CVS modules that have been checked out. It is also possible to add extra options to the maven command by clicking on the "Advanced..." button. To skip the project tests add the option "-Dmaven.test.skip=true".

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 11 / 23

An Atos Origin Company

Page 12: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

6) Select the Sonar option and enter the relevant details as shown below. Select Build periodically check box if you have schedule your build as mentioned in point 4).

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 12 / 23

An Atos Origin Company

Page 13: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

7) Click on "Save" when the configuration is done. User will be redirected to the below screen.

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 13 / 23

An Atos Origin Company

Page 14: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

6)Running/Build and Watching a Job

1) Click on Build Now link available on left side menu list. This will begin the Building/Run process of the all the modules listed in wlp-cc job.

2) Once the job is running, you will see the running job listed in the queue in the dashboard and on the job home page.

3) To see the progress of the currently running job you can view the output as the job is

running.

4) To do this navigate the jobs home page and click Console Output. If the job is complete,

this will display the static output that was generated by the build script, if the job is still

running Hudson contantly refresh the content of the page so that you can see output as it

occurs.

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 14 / 23

An Atos Origin Company

Page 15: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

Once the build is complete, there are three places where the complete job will be displayed.

a. On the Hudson Dash board

b. Job Home page

c. By clicking on the specific build link from the history, you can navigate the build home page that

d. Hudson created specifically for this build instance.

e. As sonar is integrated with Hudson you can also view the job completion report on Sonar.

i. Access URL http://10.24.231.113:8080/sonar/

ii. Sonar Home page will be displayed as shown below.

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 15 / 23

An Atos Origin Company

Page 16: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

iii. Click on the link of the job which is build

iv. User will be redirected to Sonar Dashboard.

v. Click on Component link available in left menu

vi. List of all successful build modules under wlp-cc (Sonar) job will be

displayed

Sonar Home Page screen

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 16 / 23

An Atos Origin Company

Page 17: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

Sonar Dashboard Screen

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 17 / 23

An Atos Origin Company

Page 18: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

Component Screen displaying successful modules build on Hudson.

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 18 / 23

An Atos Origin Company

Page 19: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

Job State: there are four types of job state such as:

a. Successful. The build completed and was considered as stable.

b. Unstable. The build completed and was considered as unstable.

c. Failed. The build failed.

d. Disabled. Job is disabled.

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 19 / 23

An Atos Origin Company

Page 20: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

7)Troubleshooting

Q1: I entered correct DAS login and DAS Password as required on Hudson Home Page. It did

not display me the configure option.

A1: Reason for this is the DAS Id which you enter should have access rights for that Project. For

this you need to send an email to TPM.

Q2: I tried to run the "Build XXX" job on Hudson to build my project, but I get this error in the console and the build fails. What should I do?

started[workspace] $ /usr/local/bin/cvs -q -z3 update -PdC -D "Wednesday, August 5, 2009 9:35:22 AM UTC"? wlp-ifm-provider/target/classes? wlp-ifm-provider/target/maven-archiver? wlp-ifm-provider/target/test-classes? wlp-ifm-provider/target/wlp-ifm-provider-1.0.1.jarP wlp-ifm-core/src/main/config/resource-bindings.propertiescvs update: move away wlp-ifm-provider/target/classes/IFMServiceContractResources.properties; it is in the wayC wlp-ifm-provider/target/classes/IFMServiceContractResources.propertiescvs update: move away wlp-ifm-provider/target/classes/commoncard.properties; it is in the wayC wlp-ifm-provider/target/classes/commoncard.propertiescvs update: move away wlp-ifm-provider/target/maven-archiver/dummy.txt; it is in the wayC wlp-ifm-provider/target/maven-archiver/dummy.txtcvs update: move away wlp-ifm-provider/target/maven-archiver/pom.properties; it is in the wayC wlp-ifm-provider/target/maven-archiver/pom.properties

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 20 / 23

An Atos Origin Company

Page 21: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

U wlp-ifm-provider/target/surefire-reports/dummy.txtFATAL: CVS failed. exit code=1finished: FAILURE

A2: Hudson cannot resolve CVS conflicts. You should not commit files that are generated into the CVS

repositoy, in general the contents of the <project>/target folder should not be committed. To resolve

the issue, remove the conflicting files from CVS and relaunch the build job.

Q3: I tried to run the "Build XXX" job on Hudson to build my project, but I get this error in the

console and the build fails.

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 21 / 23

An Atos Origin Company

Page 22: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 22 / 23

An Atos Origin Company

Page 23: Continuous Integration Usage Guideline

SOLUTION AND PLATFORM OF PAYMENT

CONTINUOUS INTEGRATION WITH HUDSON

ISSUE: 1.0

DATE: 15/09/2010

A3: The Reason for this is wlp-cc-listmanager-items-core:jar:2.0.0 has been committed to head

of project in CVS. But this jar version isn’t available in Nexus.

Q4: I tried to run the "Build XXX" job on Hudson to build my project, but I get error”Unable to

download XXXX” in the console and the build fails.

A4: It can be a network issue or the above error can occur also when Nexus repository is down.

You need to send email to the concerned member.

ã 2007 Atos Worldline Version 1.0 / Confidentiality page: 23 / 23

An Atos Origin Company