Unity Jenkins使用记录配置部分

2019/12/26 Unity

Java

Java SE Development Kit 8 Downloads

安装Jenkins

1. 下载安装

Jenkins

2. 命令行安装(Mac推荐)

Mac下使用命令行安装 jenkins 方法

重启电脑

jenkins start

http://localhost:8080/

http://localhost:8080/exit //退出Jenkins
http://localhost:8080/restart //重启
http://localhost:8080/reload //重新加载

3. 插件


更新gradle 配置文件 .bash_profile

source ~/.bash_profile

  • AnsiColor
  • Timestamp
  • Unity
  • XCode
  • Locale (中文插件)

      配置Manage Jenkins>Configure System> Locale
      语言填 zh_CN
      勾选强制设置语言
    

4. 配置

archive the artifacts 匹配多个文件(“,” 符号隔开)

Jenkins multiple artifacts for the same build

示例:

builds/${BUILD_NUMBER}/*.xml,builds/${BUILD_NUMBER}/*.zip,builds/${BUILD_NUMBER}/**/*.zip,builds/${BUILD_NUMBER}/**/*.obb,builds/${BUILD_NUMBER}/**/build/outputs/apk/debug/*.apk,builds/${BUILD_NUMBER}/**/build/outputs/apk/release/*.apk

Unity命令行示例

-quit  -batchmode  -projectPath  "${WORKSPACE}" -buildTarget ${platform} -executeMethod  GameBear.SmartBuild.Internal.SmartBuilderJenkins.Build -logFile "${WORKSPACE}/builds/${BUILD_NUMBER}/unity3d_defineSymbols.log"  -silent-crashes -bbBuildPath "${WORKSPACE}/builds/${BUILD_NUMBER}" -bbVersion ${version} -bbDevelopment ${development} -bbGenerateBundle ${generateBundle} -bbKeystoreName android_release.keystore -bbKeystorePass 123456 -bbIsSplit ${isObb} -bbIsBuildBundle ${isBuildBundle} -bbBundleVersion ${bundleVersion} -bbDisableGm ${disableGm} -bbEnableTuto ${enableTuto} -bbAutoLogin ${autoLogin} -bbPingServer ${pingServer} -bbEnableMusic ${enableMusic} -bbConfigName ${configName} -bbCdnType ${cdnType} cat unity.log | grep error

自动删除旧的归档文件

1

其他

Command line arguments

配置全局变量Manage Jenkins -> Configure System -> 全局属性 -> Environment

Please provide an auth token with USYM_UPLOAD_AUTH_TOKEN environment variable 问题修复

unity 命令行打包,解决报错:USYM_UPLOAD_AUTH_TOKEN environment variable_游戏_muqian328的博客-CSDN博客

Building a Unity game for iOS with fastlane fails with missing USYM_UPLOAD_AUTH_TOKEN