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

上一篇:Jenkins构建脚本中启动tomcat关键


下一篇:以0,1,2,3,4,5,6,7,8,9组成一个数组,列出所有不重复的3个数的排列