diff --git a/Jenkinsfile_release b/Jenkinsfile_prod similarity index 95% rename from Jenkinsfile_release rename to Jenkinsfile_prod index 02abeda..31904f5 100644 --- a/Jenkinsfile_release +++ b/Jenkinsfile_prod @@ -7,8 +7,8 @@ // The configuration is done in Jenkins -> Manage Jenkins -> Configure System -> Global Pipeline Libraries @Library("my-shared-lib") _ -Pipeline_release( - name: "releaseGame", // the name of the project used to identify in many places *including sky* +Pipeline_prod( + name: "prodGame", // 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) diff --git a/vars/Pipeline_dev.groovy b/vars/Pipeline_dev.groovy index ff11423..1b5d3c7 100644 --- a/vars/Pipeline_dev.groovy +++ b/vars/Pipeline_dev.groovy @@ -10,7 +10,7 @@ def call(Map config) agent none stages { - stage("Build Android") + stage("Checkout Unity Project") { agent { @@ -18,11 +18,48 @@ def call(Map config) } options { - timeout(time: 2, unit: 'HOURS') + timeout(time: 1, unit: 'HOURS') } steps { - echo 'Test dev 222' + checkout([ + $class: 'GitSCM', + branches: [[name: '*/main']], // 分支名 + userRemoteConfigs: [[ + url: 'git@gitea.bywaystudios.com:pet_home/AplusB_Pet_nation.git', + credentialsId: '503eaa43-0676-40ac-81c0-d9c5cc8b4ff7' + ]] + ]) + } + } + stage("Build Unity Android") + { + agent + { + label config.winbakeLabel + } + options + { + timeout{time: 2, unit: 'HOURS'} + } + steps + { + buildBundlesAndroid config + } + } + stage("AchiveArtifact") + { + agent + { + label config.winbakeLabel + } + options + { + timeout{time: 1, unit: 'HOURS'} + } + steps + { + archiveArtifact "Android_dev" } } } diff --git a/vars/Pipeline_release.groovy b/vars/Pipeline_prod.groovy similarity index 100% rename from vars/Pipeline_release.groovy rename to vars/Pipeline_prod.groovy diff --git a/vars/achiveArtifact.groovy b/vars/achiveArtifact.groovy new file mode 100644 index 0000000..177de1a --- /dev/null +++ b/vars/achiveArtifact.groovy @@ -0,0 +1,17 @@ +//================================================================= +// Byway Studios Inc. Confidential Information. +// Copyright Byway Studios Inc. All rights reserved +//================================================================= + +def call(publishSubFolder) +{ + // Move artifacts to an Android subdirectory + bat """ + if exist tmpPublish rmdir /S /Q tmpPublish + mkdir tmpPublish + copy /Y apk\\*.* tmpPublish\\ + del /F /S /Q apk\\*.* + move /Y tmpPublish apk\\${publishSubFolder} + """ + archiveArtifacts artifacts: 'apk/**/*', fingerprint: true +} \ No newline at end of file diff --git a/vars/execUnityMethod_Windows.groovy b/vars/execUnityMethod_Windows.groovy index 4dfcccd..4b896dc 100644 --- a/vars/execUnityMethod_Windows.groovy +++ b/vars/execUnityMethod_Windows.groovy @@ -24,7 +24,7 @@ def call(clearPackageCache,methodName) //open unity and execute unity method bat label: "Executing Unity method: ${methodName}", script: """ - set UNITY_PATH=C:\\Unity\\Editor\\${gUnityVersion_Windows}\\Editor\\Unity.exe + set UNITY_PATH=C:\\Program Files\\Unity\\Hub\\Editor\\${gUnityVersion_Windows}\\Editor\\Unity.exe "%UNITY_PATH%" -quit -batchmode -nographics -projectPath "${WORKSPACE}" -executeMethod "${methodName}" -buildTarget Android -stackTraceLogType None -logFile - """ }