jenkins

Jenkins——测试环境参数配置

2017-06-16  本文已影响0人  yuanf_689a

在实际开发过程中,提交测试后,需要修改为测试环境的配置,考虑可以在pom中进行环境参数配置,直接部署。
1、pom配置

<pre>      
<build>....
  <resources>
    <resource>      <!-- 开启过滤. -->
      <directory>${project.basedir}/src/main/resources</directory>
      <filtering>true</filtering>
    </resource>
  </resources>
</build>
  </pre> 
<pre>   
<profiles>
        <profile>
            <id>dev</id>    <!-- 针对开发环境的配置. -->
            <properties>    
                <zk.host>10.0.6.179:2181</zk.host>          
            </properties>
        </profile>
        <profile>
            <id>test</id>   <!-- 针对测试环境的配置. -->
            <properties>    
                <zk.host>192.168.1.63:2181</zk.host>            
            </properties>
        </profile>
    </profiles>
</pre>

2、zk配置
zk.properties参数可配置
zk.project.name = ${zk.project.name}
zk.host = ${zk.host}
3、jenkins配置
构建命令使用clean install -P test

Paste_Image.png
上一篇 下一篇

猜你喜欢

热点阅读