This commit is contained in:
mwh 2025-12-25 12:26:18 +08:00
parent cc5ec62f94
commit 8e339629e8
7 changed files with 189 additions and 6 deletions

View File

@ -1,13 +1,13 @@
//=================================================================
// Hothead Games Inc. Confidential Information.
// Copyright Hothead Games Inc. All rights reserved
// Byway Studios Inc. Confidential Information.
// Copyright Byway Studios Inc. All rights reserved
//=================================================================
// The library source code is located at //DevOps/Jenkinsfiles/SharedLibrary
// The library source code is located at //DevOps/Jenkinsfiles
// The configuration is done in Jenkins -> Manage Jenkins -> Configure System -> Global Pipeline Libraries
@Library(["common-shared-library", "baseballbattle-shared-library"]) _
baseballbattlePipeline name: "baseballbattle", // the name of the project used to identify in many places *including sky*
petHomePipeline name: "baseballbattle", // the name of the project used to identify in many places *including sky*
branch: "//Projects/CreativeCrew/baseballbattle/dev", // the code branch to checkout on Perforce
branchConfig: "dev", // the current code branch; dev, stable, etc
rootDir: "//Projects/CreativeCrew/baseballbattle/dev", // root directory for your code (not a virtual stream)
@ -15,8 +15,8 @@ baseballbattlePipeline name: "baseballbattle", // the name of the project used t
serverConfigurations: "dev", // semicolon separated, example: "dev;stable;prod"
alwaysClearPackageCache: false, // always clear the Library/PackageCache before running Unity commands
devBucket: "hothead-baseballbattle-dev", // s3 dev bucket
winbakeLabel: "win_unity_2020", // optional node labels. Valid entries: macbakeLabel, linuxbakeLabel, winbakeLabel, syncLabel
macbakeLabel: "xcode_12_5_m1", // optional node labels. Valid entries: macbakeLabel, linuxbakeLabel, winbakeLabel, syncLabel
winbakeLabel: "windows_2022", // optional node labels. Valid entries: macbakeLabel, linuxbakeLabel, winbakeLabel, syncLabel
macbakeLabel: "mac_2022", // optional node labels. Valid entries: macbakeLabel, linuxbakeLabel, winbakeLabel, syncLabel
appcenterlinuxbakeLabel: "baseballbattle-jpt-linuxbake01",
slackChannel: "super-hit-baseball-jenkins", // channel to send notifications to
alwaysEmailList: "", // emails to always send notifications to; space separated list

30
Jenkinsfile_test Normal file
View File

@ -0,0 +1,30 @@
//=================================================================
// Byway Studios Inc. Confidential Information.
// Copyright Byway Studios Inc. All rights reserved
//=================================================================
// The library source code is located at //DevOps/Jenkinsfiles
// The configuration is done in Jenkins -> Manage Jenkins -> Configure System -> Global Pipeline Libraries
@Library(["common-shared-library", "baseballbattle-shared-library"]) _
testPipeline name: "TestGame", // the name of the project used to identify in many places *including sky*
branch: "//Projects/CreativeCrew/baseballbattle/dev", // the code branch to checkout on Perforce
branchConfig: "dev", // the current code branch; dev, stable, etc
rootDir: "//Projects/CreativeCrew/baseballbattle/dev", // root directory for your code (not a virtual stream)
iOSScript: "ios_build_dev_development.sh", // name of the iOS build script to run
serverConfigurations: "dev", // semicolon separated, example: "dev;stable;prod"
alwaysClearPackageCache: false, // always clear the Library/PackageCache before running Unity commands
devBucket: "hothead-baseballbattle-dev", // s3 dev bucket
winbakeLabel: "windows_2022", // optional node labels. Valid entries: macbakeLabel, linuxbakeLabel, winbakeLabel, syncLabel
macbakeLabel: "mac_2022", // optional node labels. Valid entries: macbakeLabel, linuxbakeLabel, winbakeLabel, syncLabel
appcenterlinuxbakeLabel: "baseballbattle-jpt-linuxbake01",
slackChannel: "super-hit-baseball-jenkins", // channel to send notifications to
alwaysEmailList: "", // emails to always send notifications to; space separated list
appCenterUpload: true,
appCenterParams: '[{ "appCenterToken": "1357ac0bd4b04fc74ced7a95720d592e451f98b8", "appCenterAppId": "Hothead-Games/Super-Hit-Baseball-Android-Dev-Dev-Debug", "appCenterGroup": "Collaborators", "filePathMatch": "Dev_Android", "fileNameMatch": "_google_dev_", "fileTypeMatch": "apk" }, { "appCenterToken": "29aff98b9cff8aadff82e8ecec6f8bda8933e6c7", "appCenterAppId": "Hothead-Games/Super-Hit-Baseball-iOS-Dev-Dev-Debug", "appCenterGroup": "Collaborators", "filePathMatch": "Dev_iOS", "fileNameMatch": "_dev_DevMode_devServer_enterprise_", "fileTypeMatch": "ipa" }]',
// prod-specific flags
uploadToProd: false, // uploads CDN and code packages to prod
buildFinalConfig: false, // build the 'final' configuration
prodBucket: "hothead-baseballbattle-prod", // s3 prod bucket
// baseball custom params
slackWebhook: "https://hooks.slack.com/services/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" // used by CDN Upload portion of script for reporting

View File

@ -0,0 +1,16 @@
//=================================================================
// Byway Studios Inc. Confidential Information.
// Copyright Byway Studios Inc. All rights reserved
//=================================================================
def call(config){
//Clean any previously build asset bundles
bat """
if exist "${WORKSPACE}\\AB" del /F /S /Q "${WORKSPACE}\\AB\\*"
"""
//Generate AssetBundle to AB //params: is Clean packageCache,Build Method
execUnityMethod_Windows config.alwaysClearPackageCache, "MyBuildTool.StartBuildAndroid"
//stash in pipeline , maybe wait to make differents
//stash allowEmpty: true, includes: '**/AB/**', name:"${config.name}_bundles_android"
}

View File

@ -0,0 +1,13 @@
//=================================================================
// Byway Studios Inc. Confidential Information.
// Copyright Byway Studios Inc. All rights reserved
//=================================================================
def call(pathToProjectVersion)
{
String projectVersionContents = readFile(pathToProjectVersion)
String unityVersion = projectVersionContents.split('\n')[0].split(':')[1].trim()
unsafeEcho "Detected Unity Version as: " + unityVersion
return unityVersion
}

View File

@ -0,0 +1,30 @@
//=================================================================
// Byway Studios Inc. Confidential Information.
// Copyright Byway Studios Inc. All rights reserved
//=================================================================
@groovy.transform.Field gUnityVersion_Windows = ""
def call(clearPackageCache,methodName)
{
if(gUnityVersion_Windows.isEmpty())
{
gUnityVersion_Windows = detectUnityVersion "${WORKSPACE}/ProjectSettings/ProjectVersion.txt"
}
// if (clearPackageCache || params.CLEAN)
// {
// bat label: 'Clearing Unity Cache', script: """
// if exist "${WORKSPACE}\\unity\\Library\\PackageCache" del /F /S /Q "${WORKSPACE}\\unity\\Library\\PackageCache"
// if exist "${WORKSPACE}\\unity\\Library\\ScriptAssemblies" del /F /S /Q "${WORKSPACE}\\unity\\Library\\ScriptAssemblies"
// if "%CLEAN%" == "true" (
// echo ">>> CLEAN ENABLED -- DELETING LIBRARY"
// del /S /Q "${WORKSPACE}\\unity\\Library"
// )
// """
// }
//open unity and execute unity method
bat label: "Executing Unity method: ${methodName}", script: """
set UNITY_PATH=C:\\Unity\\Editor\\${gUnityVersion_Windows}\\Editor\\Unity.exe
"%UNITY_PATH%" -quit -batchmode -nographics -projectPath "${WORKSPACE}" -executeMethod "${methodName}" -buildTarget Android -stackTraceLogType None -logFile -
"""
}

View File

@ -0,0 +1,47 @@
//=================================================================
// 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}"
]
}
}
}
}

View File

@ -0,0 +1,47 @@
//=================================================================
// 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
{
echo 'Test 111'
}
}
}
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}"
]
}
}
}
}