ant+jmeter+jenkins+git持续集成以及邮件报告展示

前序准备工作:

  1. ant--下载地址:http://ant.apache.org/bindownload.cgi
  2. jmeter--下载地址:http://jmeter.apache.org/download_jmeter.cgi
  3. jenkins--下载地址:https://jenkins.io/
  4. git--下载地址:https://git-scm.com/downloads
  5. jdk--http://www.oracle.com/technetwork/java/javase/downloads/index.html

安装工具:

  常用的软件安装,环境变量配置,略……不会的可以百度

ant配置:

  1. 将jmeter安装目录下\apache-jmeter-3.2\extras的ant-jmeter-1.1.1.jar复制到ant安装目录下apache-ant-1.10.1\lib
  2. 新建build.xml文件,按照下面的模版进行适当的修改。
<?xml version="1.0" encoding="UTF-8"?>

<project name="ant-jmeter-test" default="run" basedir=".">
    <tstamp>
        <format property="time" pattern="yyyyMMddhhmm" />
    </tstamp>

    <property environment="env"/>
    <property name="ReportName" value="TestReport" />
    <!-- 需要改成自己本地的 Jmeter 目录-->
    <property name="jmeter.home" value="D:\work\soft\apache-jmeter-3.2" />
    <!-- jmeter生成jtl、html格式的结果报告的路径-->
    <property name="jmeter.result.dir" value="${env.WORKSPACE}/results/${env.BUILD_ID}" />
    <!-- 生成的报告的前缀-->
    <property name="jmeter.result.jtlName" value="${jmeter.result.dir}/${ReportName}.jtl" />
    <property name="jmeter.result.htmlName" value="${jmeter.result.dir}/${ReportName}.html" />
    <!-- GIT拉取到本地目录路径 -->
    <property name="githome" value="${env.WORKSPACE}/autoscript/汇总/" />

    <target name="run">
        <echo message="start..."/>
        <antcall target="clean" />
        <antcall target="test" />
        <antcall target="report" />
    </target>

    <target name="clean">
        <mkdir dir="${env.WORKSPACE}/results/${env.BUILD_ID}" />
    </target>

    <target name="test">
        <taskdef name="jmeter" classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask" />
        <jmeter jmeterhome="${jmeter.home}" resultlog="${jmeter.result.jtlName}">
            <!-- 声明要运行的脚本"*.jmx"指包含此目录下的所有jmeter脚本-->
             <testplans dir="${githome}\坐席基本功能" includes="坐席基本功能汇总.jmx" />

            <property name="jmeter.save.saveservice.output_format" value="xml"/>
        </jmeter>
    </target>

    <path id="xslt.classpath">
        <fileset dir="${jmeter.home}/lib" includes="xalan*.jar"/>
        <fileset dir="${jmeter.home}/lib" includes="serializer*.jar"/>
    </path>

    <target name="report">
     <tstamp> <format property="report.datestamp" pattern="yyyy/MM/dd HH:mm" /></tstamp>
        <xslt
              classpathref="xslt.classpath"
              force="true"
              in="${jmeter.result.jtlName}"
              out="${jmeter.result.htmlName}"
              style="${jmeter.home}/extras/jmeter.results.shanhe.me.xsl">
              <param name="dateReport" expression="${report.datestamp}"/>
              </xslt>
        <!-- 因为上面生成报告的时候,不会将相关的图片也一起拷贝至目标目录,所以,需要手动拷贝 -->
        <copy todir="${jmeter.result.dir}">
            <fileset dir="${jmeter.home}/extras">
                <include name="collapse.png" />
                <include name="expand.png" />
            </fileset>
        </copy>
    </target>
</project>

    3.cmd进入build.xml文件目录,使用ant命令测试是否生效

jmeter配置:

  打开jmeter安装目录apache-jmeter-3.2\bin中的jmeter.properties,把jmeter.save.saveservice.output_format=csv  值修改为xml,即:         jmeter.save.saveservice.output_format=xml

git配置:

由于我本机装了sourcetree和git,私钥已经生成过,所以不知道是否有影响,可以先跳过,如果后续的jenkins无法集成git,可以参考这篇文章,后续我也会更新在新环境下的配置流程http://www.cnblogs.com/xuange306/p/6403907.html

jenkins配置:

  1. 打开jenkins,进入插件管理,安装插件:Performance PluginHTML Publisher pluginEmail Extension PluginAnt Plugin……附上我的插件安装列表

  2.进入系统管理的Global Tool Configuration,配置ant、jdk、git的安装路径

  3.进入系统管理的系统设置,进行全局的配置。注意:系统管理员邮件地址一定要跟邮件配置的发件人地址一致

  4. 回到jenkins主页,新建一个job,选择自由风格

  • 源码管理
    •   选择git,Repository URL输入git地址:http://192.168.***.10/**r/**ter.git
    •   Credentials点击ADD,增加自己的git帐号。如:
    •   Credentials选择上步增加的帐号
    • Branch Specifier (blank for ‘any‘)输入自己项目的分支,我的项目在master下,就输入*/master
  • 构建触发器
    •   选择Build periodically。输入30 22 * * *     --代表每天的22:30执行
  • 构建
    • 增加构建步骤--Invoke ant:Ant Version选择上面步骤配置ant的变量名称ANT HOME;Targets输入run;Build File输入上述步骤的ant build.xml的文件路径:D:\work\antxml\build-通信平台.xml
    • 增加构建步骤--Execute Windows batch command:输入

      echo %WORKSPACE%
      echo %BUILD_ID%
      cd results
      cd %BUILD_ID%
  • 构建后操作
    • 增加Publish HTML reports:HTML directory to archive输入results\$BUILD_ID;Index page[s]输入TestReport.html;Report title输入HTML Report
    • 增加Publish Performance test result report:性能监控的,可以先忽略配置
    • 增加Editable Email Notification:基本配置介绍了,我之前的jenins文章有过介绍,额外增加一个附件的配置:Attachments输入results\$BUILD_ID\TestReport.html

附上我的配置图:

到此为止,jenkins的基本配置就算完成,保存后,点击立即构建,查看效果:

可以看到有NAN的出现,下面我们开始对jenkins的报告进行优化。。。



首先解决调NAN的问题

1. 打开jmeter安装目录apache-jmeter-3.2\extras的build.xml,修改为如下:

<?xml version="1.0"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<project name="ant-jmeter" default="all">
    <description>

        Sample build file for use with ant-jmeter.jar
        See http://www.programmerplanet.org/pages/projects/jmeter-ant-task.php

    To run a test and create the output report:
        ant -Dtest=script

    To run a test only:
        ant -Dtest=script run

    To run report on existing test output
        ant -Dtest=script report

    The "script" parameter is the name of the script without the .jmx suffix.

    Additional options:
        -Dshow-data=y - include response data in Failure Details
        -Dtestpath=xyz - path to test file(s) (default user.dir).
                         N.B. Ant interprets relative paths against the build file
        -Djmeter.home=.. - path to JMeter home directory (defaults to parent of this build file)
        -Dreport.title="My Report" - title for html report (default is ‘Load Test Results‘)
    </description>

    <property name="testpath" value="${user.dir}"/>
    <property name="jmeter.home" value="${basedir}/.."/>
    <property name="report.title" value="**接口自动化测试报告"/>

    <!-- Name of test (without .jmx) -->
    <property name="test" value="Test"/>

    <!-- Should report include response data for failures? -->
    <property name="show-data" value="n"/>

    <property name="format" value="2.1"/>

    <condition property="style_version" value="_21">
        <equals arg1="${format}" arg2="2.1"/>
    </condition>

    <condition property="funcMode">
        <equals arg1="${show-data}" arg2="y"/>
    </condition>

    <condition property="funcMode" value="false">
      <not>
        <equals arg1="${show-data}" arg2="y"/>
      </not>
    </condition>

    <!-- Allow jar to be picked up locally -->
    <path id="jmeter.classpath">
        <fileset dir="${basedir}">
          <include name="ant-jmeter*.jar"/>
        </fileset>
    </path>

    <taskdef
        name="jmeter"
        classpathref="jmeter.classpath"
        classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask"/>

    <target name="all" depends="run,report"/>

    <target name="run">
        <echo>funcMode = ${funcMode}</echo>
        <delete file="${testpath}/${test}.html"/>
        <jmeter
            jmeterhome="${jmeter.home}"
            testplan ="${testpath}/${test}.jmx"
            resultlog="${testpath}/${test}.jtl">
        <!--
            <jvmarg value="-Xincgc"/>
            <jvmarg value="-Xmx128m"/>
            <jvmarg value="-Dproperty=value"/>
            <jmeterarg value="-qextra.properties"/>
        -->
            <!-- Force suitable defaults -->
            <property name="jmeter.save.saveservice.output_format" value="xml"/>
            <property name="jmeter.save.saveservice.assertion_results" value="all"/>
            <property name="jmeter.save.saveservice.bytes" value="true"/>
            <property name="file_format.testlog" value="${format}"/>
            <property name="jmeter.save.saveservice.response_data.on_error" value="${funcMode}"/>
        </jmeter>
    </target>

    <property name="lib.dir" value="${jmeter.home}/lib"/>

    <!-- Use xalan copy from JMeter lib directory to ensure consistent processing with Java 1.4+ -->
    <path id="xslt.classpath">
        <fileset dir="${lib.dir}" includes="xalan*.jar"/>
        <fileset dir="${lib.dir}" includes="serializer*.jar"/>
    </path>

    <target name="report" depends="xslt-report,copy-images">
        <echo>Report generated at ${report.datestamp}</echo>
    </target>

    <target name="xslt-report" depends="_message_xalan">
        <tstamp><format property="report.datestamp" pattern="yyyy/MM/dd HH:mm"/></tstamp>
        <xslt
            classpathref="xslt.classpath"
            force="true"
            in="${testpath}/${test}.jtl"
            out="${testpath}/${test}.html"

            style="${jmeter.home}/extras/jmeter-results-detail-report_21.xsl">
            <param name="showData" expression="${show-data}"/>
            <param name="titleReport" expression="${report.title}"/>
            <param name="dateReport" expression="${report.datestamp}"/>
        </xslt>
    </target>
<!--style="${basedir}/jmeter-results-detail-report${style_version}.xsl">-->
    <!-- Copy report images if needed -->
    <target name="copy-images" depends="verify-images" unless="samepath">
        <copy file="${basedir}/expand.png" tofile="${testpath}/expand.png"/>
        <copy file="${basedir}/collapse.png" tofile="${testpath}/collapse.png"/>
    </target>

    <target name="verify-images">
        <condition property="samepath">
                <equals arg1="${testpath}" arg2="${basedir}" />
        </condition>
    </target>

    <!-- Check that the xalan libraries are present -->
    <condition property="xalan.present">
          <and>
              <!-- No need to check all jars; just check a few -->
            <available classpathref="xslt.classpath" classname="org.apache.xalan.processor.TransformerFactoryImpl"/>
            <available classpathref="xslt.classpath" classname="org.apache.xml.serializer.ExtendedContentHandler"/>
          </and>
    </condition>

    <target name="_message_xalan" unless="xalan.present">
          <echo>Cannot find all xalan and/or serialiser jars</echo>
        <echo>The XSLT formatting may not work correctly.</echo>
        <echo>Check you have xalan and serializer jars in ${lib.dir}</echo>
    </target>

</project>

2. 运行后的效果图如下:

3. 显示没问题了,但是又碰到另一问题,这样的报告会把同一个接口自动归类的一个标签下面,如下图,正常签入下面有好多个签入接口,没有按照我脚本中的分组去显示



接着优化

1. 在网上找到一个模版,下载地址:http://shanhe.me/2011/06/07/new-xsl-stylesheet-for-jmeter-command-line-results-report

2. 将下载好的模版存放在jmeter安装目录apache-jmeter-3.2\extras中。

3. 再次打开jmeter安装目录apache-jmeter-3.2\extras的build.xml,将<!--style="${basedir}/jmeter-results-detail-report${style_version}.xsl">-->替换为下载的模版文件style="${basedir}/jmeter.results.shanhe.me.xsl">

<?xml version="1.0"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<project name="ant-jmeter" default="all">
    <description>

        Sample build file for use with ant-jmeter.jar
        See http://www.programmerplanet.org/pages/projects/jmeter-ant-task.php

    To run a test and create the output report:
        ant -Dtest=script

    To run a test only:
        ant -Dtest=script run

    To run report on existing test output
        ant -Dtest=script report

    The "script" parameter is the name of the script without the .jmx suffix.

    Additional options:
        -Dshow-data=y - include response data in Failure Details
        -Dtestpath=xyz - path to test file(s) (default user.dir).
                         N.B. Ant interprets relative paths against the build file
        -Djmeter.home=.. - path to JMeter home directory (defaults to parent of this build file)
        -Dreport.title="My Report" - title for html report (default is ‘Load Test Results‘)
    </description>

    <property name="testpath" value="${user.dir}"/>
    <property name="jmeter.home" value="${basedir}/.."/>
    <property name="report.title" value="**接口自动化测试报告"/>

    <!-- Name of test (without .jmx) -->
    <property name="test" value="Test"/>

    <!-- Should report include response data for failures? -->
    <property name="show-data" value="n"/>

    <property name="format" value="2.1"/>

    <condition property="style_version" value="_21">
        <equals arg1="${format}" arg2="2.1"/>
    </condition>

    <condition property="funcMode">
        <equals arg1="${show-data}" arg2="y"/>
    </condition>

    <condition property="funcMode" value="false">
      <not>
        <equals arg1="${show-data}" arg2="y"/>
      </not>
    </condition>

    <!-- Allow jar to be picked up locally -->
    <path id="jmeter.classpath">
        <fileset dir="${basedir}">
          <include name="ant-jmeter*.jar"/>
        </fileset>
    </path>

    <taskdef
        name="jmeter"
        classpathref="jmeter.classpath"
        classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask"/>

    <target name="all" depends="run,report"/>

    <target name="run">
        <echo>funcMode = ${funcMode}</echo>
        <delete file="${testpath}/${test}.html"/>
        <jmeter
            jmeterhome="${jmeter.home}"
            testplan ="${testpath}/${test}.jmx"
            resultlog="${testpath}/${test}.jtl">
        <!--
            <jvmarg value="-Xincgc"/>
            <jvmarg value="-Xmx128m"/>
            <jvmarg value="-Dproperty=value"/>
            <jmeterarg value="-qextra.properties"/>
        -->
            <!-- Force suitable defaults -->
            <property name="jmeter.save.saveservice.output_format" value="xml"/>
            <property name="jmeter.save.saveservice.assertion_results" value="all"/>
            <property name="jmeter.save.saveservice.bytes" value="true"/>
            <property name="file_format.testlog" value="${format}"/>
            <property name="jmeter.save.saveservice.response_data.on_error" value="${funcMode}"/>
        </jmeter>
    </target>

    <property name="lib.dir" value="${jmeter.home}/lib"/>

    <!-- Use xalan copy from JMeter lib directory to ensure consistent processing with Java 1.4+ -->
    <path id="xslt.classpath">
        <fileset dir="${lib.dir}" includes="xalan*.jar"/>
        <fileset dir="${lib.dir}" includes="serializer*.jar"/>
    </path>

    <target name="report" depends="xslt-report,copy-images">
        <echo>Report generated at ${report.datestamp}</echo>
    </target>

    <target name="xslt-report" depends="_message_xalan">
        <tstamp><format property="report.datestamp" pattern="yyyy/MM/dd HH:mm"/></tstamp>
        <xslt
            classpathref="xslt.classpath"
            force="true"
            in="${testpath}/${test}.jtl"
            out="${testpath}/${test}.html"

            style="${basedir}/jmeter.results.shanhe.me.xsl">
            <param name="showData" expression="${show-data}"/>
            <param name="titleReport" expression="${report.title}"/>
            <param name="dateReport" expression="${report.datestamp}"/>
        </xslt>
    </target>
<!--style="${basedir}/jmeter-results-detail-report${style_version}.xsl">-->
    <!-- Copy report images if needed -->
    <target name="copy-images" depends="verify-images" unless="samepath">
        <copy file="${basedir}/expand.png" tofile="${testpath}/expand.png"/>
        <copy file="${basedir}/collapse.png" tofile="${testpath}/collapse.png"/>
    </target>

    <target name="verify-images">
        <condition property="samepath">
                <equals arg1="${testpath}" arg2="${basedir}" />
        </condition>
    </target>

    <!-- Check that the xalan libraries are present -->
    <condition property="xalan.present">
          <and>
              <!-- No need to check all jars; just check a few -->
            <available classpathref="xslt.classpath" classname="org.apache.xalan.processor.TransformerFactoryImpl"/>
            <available classpathref="xslt.classpath" classname="org.apache.xml.serializer.ExtendedContentHandler"/>
          </and>
    </condition>

    <target name="_message_xalan" unless="xalan.present">
          <echo>Cannot find all xalan and/or serialiser jars</echo>
        <echo>The XSLT formatting may not work correctly.</echo>
        <echo>Check you have xalan and serializer jars in ${lib.dir}</echo>
    </target>

</project>

4. 打开jmeter安装目录apache-jmeter-3.2\bin中的jmeter.properties,增加如下配置

jmeter.save.saveservice.data_type=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.response_code=true
# response_data is not currently supported for CSV output
jmeter.save.saveservice.response_data=true
# Save ResponseData for failed samples
jmeter.save.saveservice.response_data.on_error=false
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.subresults=true
jmeter.save.saveservice.assertions=true
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.connect_time=true
jmeter.save.saveservice.samplerData=true
jmeter.save.saveservice.responseHeaders=true
jmeter.save.saveservice.requestHeaders=true
jmeter.save.saveservice.encoding=false
jmeter.save.saveservice.bytes=true
jmeter.save.saveservice.url=true
jmeter.save.saveservice.filename=true
jmeter.save.saveservice.hostname=true
jmeter.save.saveservice.thread_counts=true
jmeter.save.saveservice.sample_count=true
jmeter.save.saveservice.idle_time=true

5. 进入jenkins,再次构建,查看报告:

到这里,已经初步满足了我这次项目的需求,为了达到效果,我再报告中又增加了一个测试结果概要的描述。如下图:

具体步骤是把jmeter-results-detail-report_21.xsl中的概要复制到jmeter.results.shanhe.me.xsl中,并修改css样式。详细报告可进我的网盘下载:链接: https://pan.baidu.com/s/1jIcb1ci



贴一个最终发邮件的图吧:

附件效果图:

时间: 2024-10-17 21:16:59

ant+jmeter+jenkins+git持续集成以及邮件报告展示的相关文章

JMeter+ant+Jenkins部署持续集成环境

首先,安装好几个东西,配置好环境变量,接下来一一演示下: 1.JDK 存放路径:D:\java\jdk 环境变量: JAVA_HOME=D:\java\jdk CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar; path=%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin; cmd下输入:java -version,出现这个即为成功 2.JMeter 存放路径:D:\JMeter\apache-jmete

Ant+jmeter+jenkins 持续集成设置

1.创建任务http://i2.51cto.com/images/blog/201802/24/a5a104abf5fba828adab8bda5194ab38.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=" alt="Ant+jmeter+jenkins 持续集成设

maven---10使用Jenkins进行持续集成

0推荐文章和网站 参考文章 使用Jenkins配置Git+Maven的自动化构建 jenkins git插件安装 手动下载Jenkins插件网址 1持续集成的作用.过程和优势 持续集成就是快速.高频率地自动构建项目的所有源码,并为项目成员提供丰富的反馈信息. 快速:集成速度要尽可能的块,开发人员不希望自己提交的代码提交半天后才得到反馈. 高频率:频率越高越好,例如每隔一个小时,这样问题就可以尽早地反映出来. 自动*:持续集成应该自动触发并执行的,不应该有手工参与. 构建:包括编译.测试.审查.打

【iOS】Jenkins Gitlab持续集成打包平台搭建

Jenkins Gitlab持续集成打包平台搭建 SkySeraph July. 18th 2016 Email:[email protected] 更多精彩请直接访问SkySeraph个人站点:www.skyseraph.com 1. 相关概念 Jenkins Jenkins,一个用Java编写的开源的持续集成工具,提供了软件开发的持续集成服务,可监控并触发持续重复的工作,具有开源,支持多平台和插件扩展,安装简单,界面化管理等特点.更多介绍参考维基介绍. Gitlab GitLab是一个利用R

RF+Jenkins构建持续集成

引入RF是为了能够快速的开展自动化验收测试,Jenkins而一种持续集成工具,用于监控持续重复的工作,持续的软件版本发布/测试项目,而通过RF+Jenkins可以有利的对RF构建的接口项目进行持续集成测试.Jenkins另一个强大之处就是它的分布式构建(在Jenkins的配置中叫做节点),分布式构建能够让同一套代码在不同的环境(如:Windows和Linux系统)中编译.测试等.而且Jenkins构建的代码和产物最后自动拷贝到主节点. 简单概括而言,结合RF+Jenkins开展持续集成基本步骤:

使用jenkins实现持续集成

一.jenkins 介绍 它是一个自动化的周期性的集成测试过程,从检出代码.编译构建.运行测试.结果记录.测试统计等都是自动完成的,无需人工干预,有利于减少重复过程以节省时间.费用和工作量: 它需要有专门的集成服务器来执行集成构建: 它需要有代码托管工具支持,比如SVN: 官网地址地址:https://jenkins.io Jenkins的主要目标是监控软件开发流程,快速显示问题: jenkins持续集成中的任何一个环节都是自动完成的,无需太多的人工干预,所以它有利于减少重复过程以节省时间.费用

[转]使用jenkins实现持续集成

本文转自:https://www.cnblogs.com/zishengY/p/7170656.html 一.jenkins 介绍 它是一个自动化的周期性的集成测试过程,从检出代码.编译构建.运行测试.结果记录.测试统计等都是自动完成的,无需人工干预,有利于减少重复过程以节省时间.费用和工作量: 它需要有专门的集成服务器来执行集成构建: 它需要有代码托管工具支持,比如SVN: 官网地址地址:https://jenkins.io Jenkins的主要目标是监控软件开发流程,快速显示问题: jenk

ARTS-S gitlab与jenkins实现持续集成

jenkins配制 系统管理->管理插件->可选插件->选择安装 Gitlab Hook Plugin和Build Authorization Token Root Plugin插件. jenkins主界面->新建任务->输入一个任务名称(如myproject)->构建一个自由风格的软件项目. 进入myproject,点"配制". 在"源代码管理"选项中填上项目源代码在gitlab上的地址.如http://www.abc.com/

jenkins+github持续集成中的坑

1.前言 刚开始开发自己的独立博客的时候,每次发布都要手动打包,上传服务器,杀tomcat进程,重启,来回这么重复性工作,很快就有点不耐烦了.如果能自动化的东西,就绝不要手动了,所以自己搭建了个持续集成环境,配好了结合github进行push时自动构建,自动发布的流程,提交代码,泡杯咖啡就发布好了.本以为很简单,但没想到中间细节还是有不少坑,查了很多资料,墙都翻了好几次,把遇到的问题记录在这里. 2.正文 详细安装教程就不复制粘贴了,推荐此文手把手教你搭建Jenkins+Github持续集成环境