One, Jenkins download installation
Download the Jenkins.war package on the official website: http://jenkins-ci.org/. Put the downloaded Jenkins.war package into the folder, such as C:\jenkins, and then open the Command Line window to go to that directory, execute the java-jar jenkins.war command, when prompted: "Jenkins is fully up and running" When the boot succeeds, enter in the browser window: http://localhost:8080/can go to Jenkins ' homepage
Ii. modifying the root directory of Jenkins
By default in C:\user\.jenkins, you can modify by setting environment variables, set Jenkins_home to D:\jenkins, and then restart Jenkins
Third, install Jenkins plug-in
System Management--manage plugins--optional plugins: HTML publisher plugin, performance plugin
Iv. Configuration Job
1. On the Jenkins home page click on "New" task, select "Build a free-style software project", enter the name and click "OK"
2. Add a description of the build step:
①execute Windows Batch COMMND: This is the Windows command-line parameter (the default current path is the job workspace, if many of the commands can be written as batch files in the job directory, the reference is good)
②execute Shell: Run scripts such as Shell, Python,perl,ruby, etc.
③invoke ant: Support Ant Build
3. Add post-build operation steps: can choose according to their own needs, commonly used is to send mail, can also install Jenkins plug-ins, after installing the plugin will have the corresponding options
There are pits here:
the HTML Publisher Plugin plugin in the new Jenkins version will cause the Web page in the open to fail to load the CSS and the inability to click the button, due to the CSP, can be executed in the system System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")
management--footstep command line of Jenkins: to resolve this issue. Other HTML plugins that are caused by CSP can also be used to resolve
Iv. Save, build Job
Wu, Build.xml
1 <?XML version= "1.0" encoding= "UTF-8"?>2 3 <Projectname= "Ant-jmeter-test"default= "Run"Basedir=".">4 <Tstamp>5 <format Property= "Time"pattern= "YYYYMMDDHHMM" />6 </Tstamp>7 8 9 < PropertyEnvironment= "env"/>Ten < Propertyname= "ReportName"value= "Testreport" /> One A <!--need to change to your local Jmeter directory - - < Propertyname= "Jmeter.home"value= "D:\Jmeter-3.0" /> - <!--JMeter Generating the path of the result report in JTL format - the < Propertyname= "Jmeter.result.jtl.dir"value= "${env." Workspace}/results/${env. BUILD_ID} " /> - <!--JMeter Generating the path of the result report in HTML format - - < Propertyname= "Jmeter.result.html.dir"value= "D:\Jmeter-3.0\demo\report\html" /> - <!--The prefix of the generated report - + < Propertyname= "Jmeter.result.jtlName"value= "${JMETER.RESULT.DIR}/${REPORTNAME}.JTL" /> - < Propertyname= "Jmeter.result.htmlName"value= "${jmeter.result.dir}/${reportname}.html" /> + A <Targetname= "Run"> at <Echomessage= "Start ..."/> - <AntcallTarget= "clean" /> - <AntcallTarget= "Test" /> - <AntcallTarget= "Report" /> - </Target> - in <Targetname= "clean"> - <mkdirdir= "${env." Workspace}/results/${env. BUILD_ID} " /> to </Target> + - the <Targetname= "Test"> * <Taskdefname= "JMeter"ClassName= "Org.programmerplanet.ant.taskdefs.jmeter.JMeterTask" /> $ <JMeterJmeterhome= "${jmeter.home}"Resultlog= "${jmeter.result.jtlname}">Panax Notoginseng <!--declares the script to run. "*.jmx" means all JMeter scripts that contain this directory - - <Testplansdir= "D:\Jmeter-3.0\demo"includes= "*.JMX" /> the + < Propertyname= "Jmeter.save.saveservice.output_format"value= "xml"/> A the </JMeter> + </Target> - $ $ <PathID= "Xslt.classpath"> - <Filesetdir= "${jmeter.home}/lib"includes= "Xalan*.jar"/> - <Filesetdir= "${jmeter.home}/lib"includes= "Serializer*.jar"/> the </Path> - Wuyi the <Targetname= "Report"> - <Tstamp> <format Property= "Report.datestamp"pattern= "Yyyy/mm/dd hh:mm" /></Tstamp> Wu <XSLT - Classpathref= "Xslt.classpath" About Force= "true" $ inch= "${jmeter.result.jtlname}" - out= "${jmeter.result.htmlname}" - style= "${jmeter.home}/extras/jmeter-results-detail-report_21.xsl"> - <!--param name= "showData" expression= "${show-data}"/ - A <paramname= "Datereport"expression= "${report.datestamp}"/> + </XSLT> the <!--because the report is generated above, the related pictures will not be copied to the target directory, so we need to copy them manually . - - <CopyTodir= "${jmeter.result.html.dir}"> $ <Filesetdir= "${jmeter.home}/extras"> the <includename= "Collapse.png" /> the <includename= "Expand.png" /> the </Fileset> the </Copy> - </Target> in the the </Project>
My routines (Windows): jenkins+jmeter+ant Continuous integration