154 lines
3.7 KiB
Markdown
154 lines
3.7 KiB
Markdown
Jenkins一般是用作,打包的流程管线工具,安装包,是对应的.msi后缀程序
|
||
|
||
![[Pasted image 20240418170940.png]]
|
||
|
||
![[Pasted image 20240418171001.png]]
|
||
|
||
入口默认是8080端口,浏览器打开即可
|
||
|
||
```
|
||
localhost:8080
|
||
```
|
||
|
||
![[Pasted image 20240418171045.png]]
|
||
|
||
第一次打开,会提示设置,管理员相关
|
||
|
||
![[Pasted image 20240418171131.png]]
|
||
|
||
直接选,默认安装插件即可
|
||
|
||
![[Pasted image 20240418171207.png]]
|
||
|
||
会自动安装,有可能会安装某些插件失败,这个跟网络环境有关,有些插件,可能需要翻墙,才可以正常安装;
|
||
也可以点击Retry,重新安装;
|
||
|
||
![[Pasted image 20240418171245.png]]
|
||
|
||
![[Pasted image 20240418171328.png]]
|
||
|
||
还是设置,管理员相关,ip和端口相关
|
||
|
||
![[Pasted image 20240418171401.png]]
|
||
|
||
![[Pasted image 20240418171418.png]]
|
||
|
||
就可以输入,用户名+密码,登录了
|
||
|
||
![[Pasted image 20240418171430.png]]
|
||
|
||
新版本可能是这样
|
||
|
||
![[Pasted image 20240418171452.png]]
|
||
|
||
登录后
|
||
|
||
![[Pasted image 20240418171511.png]]
|
||
|
||
可以设置,修改成中文
|
||
|
||
![[Pasted image 20240418171746.png]]
|
||
|
||
![[Pasted image 20240418171806.png]]
|
||
|
||
点击左上角,回到主页,然后管理Jenkins,安装插件
|
||
|
||
![[Pasted image 20240418171843.png]]
|
||
|
||
![[Pasted image 20240418172537.png]]
|
||
|
||
安装Unity对应的插件
|
||
|
||
![[Pasted image 20240418172013.png]]
|
||
|
||
完成安装后,点击Tool,进行插件工具的配置
|
||
|
||
![[Pasted image 20240418172609.png]]
|
||
|
||
新增一个Unity相关的配置,是选择Unity引擎的安装目录,再取一个别名,这里测试的,是使用Unity2018
|
||
|
||
![[Pasted image 20240418172638.png]]
|
||
|
||
这是新构建一个打包流程线
|
||
|
||
![[Pasted image 20240418172727.png]]
|
||
|
||
例如,创建一个空的流程队列即可
|
||
|
||
![[Pasted image 20240418172819.png]]
|
||
|
||
这里之前创建了一个,解析即可
|
||
|
||
![[Pasted image 20240418172836.png]]
|
||
|
||
左下角会显示,构建历史,点配置,是可以修改流程线的过程逻辑
|
||
|
||
![[Pasted image 20240418172854.png]]
|
||
|
||
各项属性
|
||
|
||
![[Pasted image 20240418172943.png]]
|
||
|
||
设置一个String字符参数,是将要打包的,工程路径
|
||
|
||
![[Pasted image 20240418173145.png]]
|
||
|
||
再弄一个字符参数,是版本号
|
||
|
||
![[Pasted image 20240418173224.png]]
|
||
|
||
还有其他的字符参数,都是后续打包的时候,构建文件名字相关,用到的
|
||
|
||
![[Pasted image 20240418173259.png]]
|
||
|
||
点击“增加构建步骤”按钮,增加一个Unity插件相关的,构建Step步骤,选择前面配置好的,Unity 2018引擎;
|
||
|
||
其中的Editor command,是unity引擎的,命令行模式,输入的指令;
|
||
其中的 `%WorkPath%`、`%name%` 等字段,是上述新增的,字符参数,例如工程路径、工程名字等;
|
||
|
||
打包后的命令行中,还会cd跳转`C:\Program Files\WinRAR`文件路径,使用,C盘安装好的,压缩工具WinRAR,生成压缩包
|
||
|
||
``` shell
|
||
-projectpath %WorkPath% -quit -batchmode -executeMethod BuildApp.BuildPC Version=$Version Name=$Name -logFile "C:\log.txt"
|
||
```
|
||
|
||
``` shell
|
||
@echo off
|
||
for /f "delims= " %%i in (%WorkPath%\buildname.txt) do set name=%%i
|
||
c:
|
||
cd C:\Program Files\WinRAR
|
||
Winrar.exe a -r -ep1 "%WorkPath%\BuildTarget\Windows\%name%.rar" "%WorkPath%\BuildTarget\Windows\%name%"
|
||
```
|
||
|
||
![[Pasted image 20240418173350.png]]
|
||
|
||
调用的指令
|
||
|
||
![[Pasted image 20240418173830.png]]
|
||
|
||
保存,应用
|
||
|
||
![[Pasted image 20240418174051.png]]
|
||
|
||
点击Build,打包;
|
||
需要注意的是,打包之前,需要先把对应的Unity引擎,关闭,不然会打包失败;
|
||
|
||
![[Pasted image 20240418174113.png]]
|
||
|
||
正在构建
|
||
|
||
![[Pasted image 20240418174222.png]]
|
||
|
||
点进去,看log
|
||
|
||
![[Pasted image 20240418174300.png]]
|
||
|
||
最后显示,成功
|
||
|
||
![[Pasted image 20240418174313.png]]
|
||
|
||
输出的文件,正常
|
||
|
||
![[Pasted image 20240418174339.png]]
|
||
|