update jenkins pipeline
This commit is contained in:
parent
c4eb554bae
commit
693c457d7b
@ -7,7 +7,6 @@
|
|||||||
@Library("my-shared-lib") _
|
@Library("my-shared-lib") _
|
||||||
|
|
||||||
Pipeline_dev(
|
Pipeline_dev(
|
||||||
alwaysClearPackageCache: false, // always clear the Library/PackageCache before running Unity commands
|
|
||||||
winbakeLabel: "unity_2022_3_dev", // optional node labels. Valid entries: macbakeLabel, linuxbakeLabel, winbakeLabel, syncLabel
|
winbakeLabel: "unity_2022_3_dev", // optional node labels. Valid entries: macbakeLabel, linuxbakeLabel, winbakeLabel, syncLabel
|
||||||
execUnityMethod:"MyBuildTool.StartBuildAndroid_dev",
|
execUnityMethod:"MyBuildTool.StartBuildAndroid_dev",
|
||||||
)
|
)
|
||||||
@ -7,7 +7,6 @@
|
|||||||
@Library("my-shared-lib") _
|
@Library("my-shared-lib") _
|
||||||
|
|
||||||
Pipeline_prod(
|
Pipeline_prod(
|
||||||
alwaysClearPackageCache: false, // always clear the Library/PackageCache before running Unity commands
|
|
||||||
winbakeLabel: "unity_2022_3_prod", // optional node labels. Valid entries: macbakeLabel, linuxbakeLabel, winbakeLabel, syncLabel
|
winbakeLabel: "unity_2022_3_prod", // optional node labels. Valid entries: macbakeLabel, linuxbakeLabel, winbakeLabel, syncLabel
|
||||||
execUnityMethod:"MyBuildTool.StartBuildAndroid_prod",
|
execUnityMethod:"MyBuildTool.StartBuildAndroid_prod",
|
||||||
)
|
)
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
@Library("my-shared-lib") _
|
@Library("my-shared-lib") _
|
||||||
|
|
||||||
Pipeline_stable(
|
Pipeline_stable(
|
||||||
alwaysClearPackageCache: false, // always clear the Library/PackageCache before running Unity commands
|
|
||||||
winbakeLabel: "unity_2022_3_stable", // optional node labels. Valid entries: macbakeLabel, linuxbakeLabel, winbakeLabel, syncLabel
|
winbakeLabel: "unity_2022_3_stable", // optional node labels. Valid entries: macbakeLabel, linuxbakeLabel, winbakeLabel, syncLabel
|
||||||
execUnityMethod:"MyBuildTool.StartBuildAndroid_stable",
|
execUnityMethod:"MyBuildTool.StartBuildAndroid_stable",
|
||||||
)
|
)
|
||||||
@ -2,7 +2,9 @@
|
|||||||
// Byway Studios Inc. Confidential Information.
|
// Byway Studios Inc. Confidential Information.
|
||||||
// Copyright Byway Studios Inc. All rights reserved
|
// Copyright Byway Studios Inc. All rights reserved
|
||||||
//=================================================================
|
//=================================================================
|
||||||
def call(config){
|
|
||||||
|
def call(config)
|
||||||
|
{
|
||||||
echo("clear AB begin")
|
echo("clear AB begin")
|
||||||
//Clean any previously build asset bundles
|
//Clean any previously build asset bundles
|
||||||
bat """
|
bat """
|
||||||
@ -10,9 +12,5 @@ def call(config){
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
echo("execUnityMethod begin")
|
echo("execUnityMethod begin")
|
||||||
//Generate AssetBundle to AB //params: is Clean packageCache,Build Method
|
execUnityMethod_Windows("${config.execUnityMethod}")
|
||||||
execUnityMethod_Windows(config.alwaysClearPackageCache, "${config.execUnityMethod}")
|
|
||||||
|
|
||||||
//stash in pipeline , maybe wait to make differents
|
|
||||||
//stash allowEmpty: true, includes: '**/AB/**', name:"${config.name}_bundles_android"
|
|
||||||
}
|
}
|
||||||
@ -11,6 +11,14 @@ def call(Map config)
|
|||||||
{
|
{
|
||||||
label config.winbakeLabel
|
label config.winbakeLabel
|
||||||
}
|
}
|
||||||
|
parameters
|
||||||
|
{
|
||||||
|
booleanParam(name: 'CleanBuild', defaultValue: false, description: 'Force Clean Build to Avoid Previous Build Cache')
|
||||||
|
booleanParam(name: 'DebugBuild', defaultValue: false, description: 'To Create Debug Build for Profiling')
|
||||||
|
booleanParam(name: 'CleanCache', defaultValue: false, description: 'Force Clean Script and Package Cache')
|
||||||
|
booleanParam(name: 'CleanLibrary', defaultValue: false, description: 'Force Clean the Whole Library Folder')
|
||||||
|
hidden(name: 'BuildNonTuyoo', defaultValue: true, description: 'Should We Build APK without Tuyoo SDK Login')
|
||||||
|
}
|
||||||
options
|
options
|
||||||
{
|
{
|
||||||
skipDefaultCheckout(true) // ★ 关键:禁止 Jenkins 自动 checkout library
|
skipDefaultCheckout(true) // ★ 关键:禁止 Jenkins 自动 checkout library
|
||||||
@ -59,7 +67,7 @@ def call(Map config)
|
|||||||
}
|
}
|
||||||
steps
|
steps
|
||||||
{
|
{
|
||||||
BuildBundlesAndroid(config)
|
BuildAndroid(config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("AchiveArtifact")
|
stage("AchiveArtifact")
|
||||||
|
|||||||
@ -11,6 +11,14 @@ def call(Map config)
|
|||||||
{
|
{
|
||||||
label config.winbakeLabel
|
label config.winbakeLabel
|
||||||
}
|
}
|
||||||
|
parameters
|
||||||
|
{
|
||||||
|
hidden(name: 'CleanBuild', defaultValue: true, description: 'Force Clean Build to Avoid Previous Build Cache')
|
||||||
|
hidden(name: 'DebugBuild', defaultValue: false, description: 'To Create Debug Build for Profiling')
|
||||||
|
hidden(name: 'CleanCache', defaultValue: true, description: 'Force Clean Script and Package Cache')
|
||||||
|
hidden(name: 'CleanLibrary', defaultValue: false, description: 'Force Clean the Whole Library Folder')
|
||||||
|
hidden(name: 'BuildNonTuyoo', defaultValue: false, description: 'Should We Build APK without Tuyoo SDK Login')
|
||||||
|
}
|
||||||
options
|
options
|
||||||
{
|
{
|
||||||
skipDefaultCheckout(true) // ★ 关键:禁止 Jenkins 自动 checkout library
|
skipDefaultCheckout(true) // ★ 关键:禁止 Jenkins 自动 checkout library
|
||||||
@ -57,7 +65,7 @@ def call(Map config)
|
|||||||
}
|
}
|
||||||
steps
|
steps
|
||||||
{
|
{
|
||||||
BuildBundlesAndroid(config)
|
BuildAndroid(config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("AchiveArtifact")
|
stage("AchiveArtifact")
|
||||||
|
|||||||
@ -11,6 +11,14 @@ def call(Map config)
|
|||||||
{
|
{
|
||||||
label config.winbakeLabel
|
label config.winbakeLabel
|
||||||
}
|
}
|
||||||
|
parameters
|
||||||
|
{
|
||||||
|
hidden(name: 'CleanBuild', defaultValue: true, description: 'Force Clean Build to Avoid Previous Build Cache')
|
||||||
|
hidden(name: 'DebugBuild', defaultValue: false, description: 'To Create Debug Build for Profiling')
|
||||||
|
hidden(name: 'CleanCache', defaultValue: true, description: 'Force Clean Script and Package Cache')
|
||||||
|
hidden(name: 'CleanLibrary', defaultValue: false, description: 'Force Clean the Whole Library Folder')
|
||||||
|
hidden(name: 'BuildNonTuyoo', defaultValue: false, description: 'Should We Build APK without Tuyoo SDK Login')
|
||||||
|
}
|
||||||
options
|
options
|
||||||
{
|
{
|
||||||
skipDefaultCheckout(true) // ★ 关键:禁止 Jenkins 自动 checkout library
|
skipDefaultCheckout(true) // ★ 关键:禁止 Jenkins 自动 checkout library
|
||||||
@ -57,7 +65,7 @@ def call(Map config)
|
|||||||
}
|
}
|
||||||
steps
|
steps
|
||||||
{
|
{
|
||||||
BuildBundlesAndroid(config)
|
BuildAndroid(config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("AchiveArtifact")
|
stage("AchiveArtifact")
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
def call(publishSubFolder)
|
def call(publishSubFolder)
|
||||||
{
|
{
|
||||||
// Move artifacts to an Android subdirectory and achive
|
// Move artifacts to an Android subdirectory and archive
|
||||||
bat """
|
bat """
|
||||||
if exist tmpPublish rmdir /S /Q tmpPublish
|
if exist tmpPublish rmdir /S /Q tmpPublish
|
||||||
mkdir tmpPublish
|
mkdir tmpPublish
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
// Byway Studios Inc. Confidential Information.
|
// Byway Studios Inc. Confidential Information.
|
||||||
// Copyright Byway Studios Inc. All rights reserved
|
// Copyright Byway Studios Inc. All rights reserved
|
||||||
//=================================================================
|
//=================================================================
|
||||||
|
|
||||||
def call(pathToProjectVersion)
|
def call(pathToProjectVersion)
|
||||||
{
|
{
|
||||||
echo("Detected Unity Version begin")
|
echo("Detected Unity Version begin")
|
||||||
|
|||||||
@ -2,36 +2,33 @@
|
|||||||
// Byway Studios Inc. Confidential Information.
|
// Byway Studios Inc. Confidential Information.
|
||||||
// Copyright Byway Studios Inc. All rights reserved
|
// Copyright Byway Studios Inc. All rights reserved
|
||||||
//=================================================================
|
//=================================================================
|
||||||
|
|
||||||
@groovy.transform.Field gUnityVersion_Windows = ""
|
@groovy.transform.Field gUnityVersion_Windows = ""
|
||||||
def call(clearPackageCache,methodName)
|
|
||||||
|
def call(methodName)
|
||||||
{
|
{
|
||||||
if(gUnityVersion_Windows.isEmpty())
|
if(gUnityVersion_Windows.isEmpty())
|
||||||
{
|
{
|
||||||
gUnityVersion_Windows = detectUnityVersion("${WORKSPACE}/ProjectSettings/ProjectVersion.txt")
|
gUnityVersion_Windows = detectUnityVersion("${WORKSPACE}/ProjectSettings/ProjectVersion.txt")
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (clearPackageCache || params.CLEAN)
|
if (params.CleanCache)
|
||||||
// {
|
{
|
||||||
// bat label: 'Clearing Unity Cache', script: """
|
bat label: 'Clearing Unity Package and Script Cache', script: """
|
||||||
// if exist "${WORKSPACE}\\unity\\Library\\PackageCache" del /F /S /Q "${WORKSPACE}\\unity\\Library\\PackageCache"
|
if exist "${WORKSPACE}\\Library\\PackageCache" del /F /S /Q "${WORKSPACE}\\Library\\PackageCache"
|
||||||
// if exist "${WORKSPACE}\\unity\\Library\\ScriptAssemblies" del /F /S /Q "${WORKSPACE}\\unity\\Library\\ScriptAssemblies"
|
if exist "${WORKSPACE}\\Library\\ScriptAssemblies" del /F /S /Q "${WORKSPACE}\\Library\\ScriptAssemblies"
|
||||||
// if "%CLEAN%" == "true" (
|
if (params.CleanLibrary)
|
||||||
// echo ">>> CLEAN ENABLED -- DELETING LIBRARY"
|
(
|
||||||
// del /S /Q "${WORKSPACE}\\unity\\Library"
|
echo ">>> CLEAN ENABLED -- DELETING LIBRARY"
|
||||||
// )
|
del /S /Q "${WORKSPACE}\\Library"
|
||||||
// """
|
)
|
||||||
// }
|
"""
|
||||||
|
}
|
||||||
//def gitHash = env.GIT_COMMIT.take(7)
|
|
||||||
// def gitHash = bat(
|
|
||||||
// script: 'git rev-parse --short HEAD',
|
|
||||||
// returnStdout: true
|
|
||||||
// ).trim()
|
|
||||||
|
|
||||||
//open unity and execute unity method
|
//open unity and execute unity method
|
||||||
bat label: "Executing Unity method: ${methodName}", script: """
|
bat label: "Executing Unity method: ${methodName}", script: """
|
||||||
set UNITY_PATH=C:\\Program Files\\Unity\\Hub\\Editor\\${gUnityVersion_Windows}\\Editor\\Unity.exe
|
set UNITY_PATH=C:\\Program Files\\Unity\\Hub\\Editor\\${gUnityVersion_Windows}\\Editor\\Unity.exe
|
||||||
for /f %%i in ('git rev-parse --short HEAD') do set GIT_HASH=%%i
|
for /f %%i in ('git rev-parse --short HEAD') do set GIT_HASH=%%i
|
||||||
"%UNITY_PATH%" -quit -batchmode -nographics -projectPath "${WORKSPACE}" -executeMethod "${methodName}" -buildTarget Android -gitHash %GIT_HASH% -buildNumber %BUILD_NUMBER% -stackTraceLogType None -logFile -
|
"%UNITY_PATH%" -quit -batchmode -nographics -projectPath "${WORKSPACE}" -executeMethod "${methodName}" -buildTarget Android -gitHash %GIT_HASH% -buildNumber %BUILD_NUMBER% -cleanBuild params.CleanBuild -debugBuild params.DebugBuild -nonTuyoo params.BuildNonTuyoo -stackTraceLogType None -logFile -
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,47 +0,0 @@
|
|||||||
//=================================================================
|
|
||||||
// Byway Studios Inc. Confidential Information.
|
|
||||||
// Copyright Byway Studios Inc. All rights reserved
|
|
||||||
//=================================================================
|
|
||||||
|
|
||||||
def call(Map config)
|
|
||||||
{
|
|
||||||
pipeline
|
|
||||||
{
|
|
||||||
agent none
|
|
||||||
stages
|
|
||||||
{
|
|
||||||
stage("Build Android")
|
|
||||||
{
|
|
||||||
agent
|
|
||||||
{
|
|
||||||
label config.winbakeLabel
|
|
||||||
}
|
|
||||||
options
|
|
||||||
{
|
|
||||||
timeout{time: 2, unit: 'HOURS'}
|
|
||||||
}
|
|
||||||
steps
|
|
||||||
{
|
|
||||||
buildBundlesAndroid config
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
post
|
|
||||||
{
|
|
||||||
always
|
|
||||||
{
|
|
||||||
dingtalk(
|
|
||||||
robot:'dingtalk_unity_1',
|
|
||||||
type:'MARKDOWN',
|
|
||||||
title:'Build Notice',
|
|
||||||
text: [
|
|
||||||
"### ${currentBuild.currentResult}",
|
|
||||||
"- Project: ${env.JOB_NAME}",
|
|
||||||
"- BuildNumber: #${env.BUILD_NUMBER}",
|
|
||||||
"- Duration: ${currentBuild.durationString}",
|
|
||||||
"- LogUrl: ${env.BUILD_URL}"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user