Jenkins导出流水线记录
pipeline {
agent any
parameters {
booleanParam(
name: 'SyncSvn',
defaultValue: false,
description: ''
)
booleanParam(
name: 'BuildAssets',
defaultValue: false,
description: ''
)
booleanParam(
name: 'UnityExport',
defaultValue: false,
description: ''
)
booleanParam(
name: 'BuildAPK',
defaultValue: false,
description: ''
)
}
environment{
UNITY_PATH = "C:/OfficeSoftware/Unity2019.4.9f1/Unity/Editor/Unity.exe"
PROJECT_PATH = "E:/Project/PureProject/Unity/Proj_feiji"
SyncSvn = "$params.SyncSvn"
BuildAssets = "$params.BuildAssets"
UnityExport = "$params.UnityExport"
BuildAPK = "$params.BuildAPK"
}
tools {
gradle "gradle-5.6.4"
}
options{
disableConcurrentBuilds()
timestamps()
}
stages {
stage('更新svn'){
steps {
script{
if(SyncSvn == 'true'){
echo '更新svn'
}
}
}
}
stage('处理ab资源以及生成'){
steps {
script{
if(BuildAssets == 'true'){
bat label:'', script:"${UNITY_PATH} -projectPath ${PROJECT_PATH} -quit -batchmode -executeMethod BatBuild.BuildAssets %1 -logFile build.log"
}
}
}
}
stage('Unity导出') {
steps {
script{
if(UnityExport == 'true'){
bat label:'', script:"${UNITY_PATH} -projectPath ${PROJECT_PATH} -quit -batchmode -executeMethod BatBuild.UnityExportToJenkinsTest %1 -logFile build.log"
}
}
}
}
stage('生成apk') {
steps {
script{
if(BuildAPK == 'true'){
bat './gradlew clean build'
}
}
}
}
stage('Archive') {
steps {
archiveArtifacts artifacts: 'build/outputs/apk/debug
|