一、可运行Jar配置
1. 设置JDK
2. 设置源码
- 设置构建脚本
#!/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
- 设置通知
- 构建多个项目
二、Tomcat项目配置
- 常规配置
- 构建环境
#!/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
2d2a568d2579fddb5e28dfd4e44377b6b0256386df640a4f5b299fd127e8700c