Jenkins构建集成部署

一、可运行Jar配置

1. 设置JDK

 

2. 设置源码

 

  1. 设置构建脚本

 

#!/bin/bash  

export BUILD_ID=xxxxxx_content_170

 

myPath="/data/deploy/iol8-content-service"

core_name="content_service_core"

gitUrl="https://git.transn.com/SLS-itakeeasy-JAVA/iol8-content-service.git"

 

if [ ! -d "$myPath" ];then

   echo '目录不存在'

    cd /data/deploy

    git clone "$gitUrl"

    cd "$myPath"

    chmod +x gradlew

else

    echo '目录存在'

    cd "$myPath"

    git pull

fi

 

./gradlew :"$core_name":deploy -Denv=dev

 

  1. 设置通知

 

  1. 构建多个项目

 

 

二、Tomcat项目配置

  1. 常规配置

 

  1. 构建环境

 

 

#!/bin/bash  

export BUILD_ID=323233

export JAVA_HOME=/usr/java/jdk1.8.0_121

myPath="/data/deploy/me_api_server"

 

if [ ! -d "$myPath" ];then

   echo '目录不存在'

    cd /data/deploy

    git clone https://git.transn.com/SLS-itakeeasy-JAVA/me_api_server.git

    cd "$myPath"

    chmod +x gradlew

else

    echo '目录存在'

    cd "$myPath"

    git pull

fi

 

./gradlew :web:deploy -Denv=test_18

 

 

http://10.5.110.170:8980/

2d2a568d2579fddb5e28dfd4e44377b6b0256386df640a4f5b299fd127e8700c

posted @ 2018-03-01 10:44  BarryW  阅读(241)  评论(0编辑  收藏  举报