2023-06-29 11:55:02 +08:00
|
|
|
|
---
|
|
|
|
|
title: Perforce Helix Core搭建
|
|
|
|
|
date: 2022-12-21 14:51:55
|
|
|
|
|
excerpt:
|
|
|
|
|
tags: Perforce
|
|
|
|
|
rating: ⭐
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# Perforce Docker
|
|
|
|
|
可以使用这个容器:
|
|
|
|
|
https://hub.docker.com/r/sourcegraph/helix-p4d
|
|
|
|
|
|
|
|
|
|
但这个容器是2020年构建的,我这里重新调整了一下,并且手动构建成功,具体可以参考下文。
|
|
|
|
|
|
|
|
|
|
## DockerFile构建
|
|
|
|
|
大致步骤如下:
|
|
|
|
|
1. 下载**blueroseslol/helix-docker**仓库的所有文件。
|
|
|
|
|
2. 构建DockerFile。
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
cd /home/perforce/helix-docker/helix-p4d/ && \
|
2024-05-06 16:50:58 +08:00
|
|
|
|
docker build -f /home/perforce/helix-docker/helix-p4d/Dockerfile -t helix-p4d:2024.5 .
|
2023-06-29 11:55:02 +08:00
|
|
|
|
```
|
|
|
|
|
|
2023-07-03 11:49:02 +08:00
|
|
|
|
|
|
|
|
|
docker build --file ./helix-p4d/Dockerfile --tag helix-p4d:2023.7 .
|
|
|
|
|
|
2023-06-29 11:55:02 +08:00
|
|
|
|
## 使用
|
|
|
|
|
```shell
|
|
|
|
|
docker run -d --name helix-p4d\
|
|
|
|
|
-p 1666:1666 \
|
|
|
|
|
-v /home/perforce/p4:/p4 \
|
2024-05-06 16:50:58 +08:00
|
|
|
|
helix-p4d:2024.5
|
2023-06-29 11:55:02 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
docker run -d \
|
|
|
|
|
-p 1666:1666 \
|
|
|
|
|
-v /home/perforce/p4:/p4 \
|
|
|
|
|
sourcegraph/helix-p4d:2020.2
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Github文档
|
|
|
|
|
```shell
|
|
|
|
|
docker run --rm \
|
|
|
|
|
--publish 1666:1666 \
|
|
|
|
|
sourcegraph/helix-p4d:2020.2
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
默认端口`:1666`, 默认用户名为 `admin`, 默认密码: `pass12349ers`。以下是所有配置的默认值。
|
|
|
|
|
```shell
|
|
|
|
|
NAME=perforce-server
|
|
|
|
|
P4HOME=/p4
|
|
|
|
|
P4NAME=master
|
|
|
|
|
P4TCP=1666
|
|
|
|
|
P4PORT=1666
|
|
|
|
|
P4USER=admin
|
|
|
|
|
P4PASSWD=pass12349ers
|
|
|
|
|
P4CASE=-C0
|
|
|
|
|
P4CHARSET=utf8
|
|
|
|
|
JNL_PREFIX=perforce-server
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
可以使用`--env` 覆盖上述环境变量:
|
|
|
|
|
```shell
|
|
|
|
|
docker run --rm \
|
|
|
|
|
--publish 1666:1666 \
|
|
|
|
|
--env P4USER=amy \
|
|
|
|
|
--env P4PASSWD=securepassword \
|
|
|
|
|
sourcegraph/helix-p4d:2020.2
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
请注意,尽管服务器在重启后仍能存活(即数据被保留),但如果你在初始启动后(即镜像的第一次运行,在选项被硬编码为Perforce Helix核心服务器自身配置时)改变选项,它可能会中断。要启动一个长期运行的生产容器,记得要把数据目录(`P4HOME`)容器,把`--rm`标志换成`d`(分离):
|
|
|
|
|
```shell
|
|
|
|
|
docker run -d \
|
|
|
|
|
--publish 1666:1666 \
|
|
|
|
|
--env P4PASSWD=securepassword \
|
|
|
|
|
--volume ~/.helix-p4d-home:/p4 \
|
|
|
|
|
sourcegraph/helix-p4d:2020.2
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 推送镜像到Dockerhub
|
2024-05-06 16:50:58 +08:00
|
|
|
|
登录
|
|
|
|
|
```bash
|
|
|
|
|
docker login
|
|
|
|
|
|
|
|
|
|
# Github
|
|
|
|
|
docker login ghcr.io -u 378100977@qq.com -p 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
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
推送
|
|
|
|
|
```bash
|
|
|
|
|
docker tag 5572f8b12de1 blueroses/perforce-helix-p4d:2024.5
|
|
|
|
|
docker push blueroses/perforce-helix-p4d:2024.5
|
|
|
|
|
|
|
|
|
|
# 登录github
|
|
|
|
|
docker push ghcr.io/blueroses/perforce-helix-p4d:2024.5
|
2023-06-29 11:55:02 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# UE部分操作
|
|
|
|
|
- https://docs.unrealengine.com/5.1/en-US/using-perforce-as-source-control-for-unreal-engine/
|
|
|
|
|
- https://zhuanlan.zhihu.com/p/414193101?utm_id=0
|
|
|
|
|
|
|
|
|
|
- [UE4管理多重项目-WiseeEngineering](https://zhuanlan.zhihu.com/p/364346565)
|
|
|
|
|
- [UnrealEnigne源码构建&Perforce&(UnrealGameSync)开发版本控制基础部署](https://zhuanlan.zhihu.com/p/362276094)
|
|
|
|
|
- [打通UE4美术资源版本控制关节](https://zhuanlan.zhihu.com/p/261692804)
|
2024-05-06 16:50:58 +08:00
|
|
|
|
- [UE5+Perforce+阿里云ECS版本控制搭建流程与工作流程](https://zhuanlan.zhihu.com/p/640743305)
|
2023-06-29 11:55:02 +08:00
|
|
|
|
|
2024-05-07 10:57:46 +08:00
|
|
|
|
PS:
|
|
|
|
|
1. 编码使用:UTF8-no bom
|
|
|
|
|
2. Connection–>Edit Current Workspace–>Advanced,设置为`Line ending characters for text file:UNIX style linefeed`
|
2023-06-29 11:55:02 +08:00
|
|
|
|
|
2024-05-06 16:50:58 +08:00
|
|
|
|
## 注册源码引擎到EpicGames
|
2023-06-29 11:55:02 +08:00
|
|
|
|
经过上面的步骤,源码引擎已经构建成功,但是在对项目就行选择引擎版本的时候,发现并没有这个版本 。这是因为,构建的引擎没有注册到EpicGames中,找到EpicGames安装目录下的注册器。复制到源码工程并且运行即可。
|
|
|
|
|
```text
|
2024-05-06 16:50:58 +08:00
|
|
|
|
Launcher\Engine\Binaries\Win64\UnrealVersionSelector.exe
|
2023-06-29 11:55:02 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# Perforce
|
|
|
|
|
- https://help.perforce.com/helix-core/quickstart-unreal/Content/quickstart/game-home-quickstart.html
|
|
|
|
|
- https://www.perforce.com/manuals/p4v/Content/P4V/Home-p4v.html
|
|
|
|
|
- https://www.perforce.com/manuals/p4sag/Content/P4SAG/Home-p4sag.html
|
2024-05-06 16:50:58 +08:00
|
|
|
|
|
2024-05-07 10:57:46 +08:00
|
|
|
|
## 开发目录设计
|
|
|
|
|
- [UE4管理多重项目-WiseeEngineering(翻译)](https://zhuanlan.zhihu.com/p/364346565)
|
|
|
|
|
|
|
|
|
|
- ArtSource(美术资源:引擎中相应的美术资产应该统一从ArtSource仓库导入,这样美术人员可以集中在标准资产管线下的资产迭代,可以更加集中注意力于美术资产质量,所以前提是项目初期必须构建标准稳定的渲染和审核验收流程(这一点也是国内很多项目及经常返工,开发成本极高的原因))
|
|
|
|
|
- Engine(引擎路径,这里我用于个人使用则不需要太多的分流)
|
|
|
|
|
- Project(项目工程)
|
|
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
- e:\\Perforce
|
|
|
|
|
- ArtSource
|
|
|
|
|
- ShowRoom
|
|
|
|
|
- UnrealEngine
|
|
|
|
|
|
|
|
|
|
## depot
|
|
|
|
|
默认有depot与spec2个仓库文件。
|
|
|
|
|
- Depot:默认创建的仓库。
|
|
|
|
|
- Spec:p4admin管理员的配置文件。
|
|
|
|
|
|
2024-05-06 16:50:58 +08:00
|
|
|
|
## P4Admin
|
|
|
|
|
- 用户
|
|
|
|
|
- 用户组
|
|
|
|
|
- 目录权限
|
|
|
|
|
- 仓库
|
|
|
|
|
|
|
|
|
|
## Typemap
|
|
|
|
|
typemap 的设置能够在 Perforce 中控制文件的只读和可写的形式。 然后要做这件事情,需要管理员先在命令行cmd下设置 P4 的环境变量。
|
2023-06-29 11:55:02 +08:00
|
|
|
|
|
2024-05-07 10:57:46 +08:00
|
|
|
|
在指定仓库上右键,点击`Open Command Windows Here`,输入`p4 -P YourPassword typemap`即可在弹出的txt文件中修改保存关闭即可。(输入UE官方推荐的内容即可)
|
|
|
|
|
|
|
|
|
|
```text
|
|
|
|
|
# The form data below was edited by Jeff
|
|
|
|
|
# Perforce File Type Mapping Specifications.
|
|
|
|
|
#
|
|
|
|
|
# TypeMap: a list of filetype mappings; one per line.
|
|
|
|
|
# Each line has two elements:
|
|
|
|
|
#
|
|
|
|
|
# Filetype: The filetype to use on 'p4 add'.
|
|
|
|
|
#
|
|
|
|
|
# Path: File pattern which will use this filetype.
|
|
|
|
|
#
|
|
|
|
|
# See 'p4 help typemap' for more information.
|
|
|
|
|
|
|
|
|
|
TypeMap:
|
|
|
|
|
text //....asp
|
|
|
|
|
text //....cnf
|
|
|
|
|
text //....css
|
|
|
|
|
text //....htm
|
|
|
|
|
text //....html
|
|
|
|
|
text //....inc
|
|
|
|
|
text //....js
|
|
|
|
|
text+w //....log
|
|
|
|
|
text+w //....ini
|
|
|
|
|
text+w //....pdm
|
|
|
|
|
binary+Fl //....zip
|
|
|
|
|
binary+Fl //....bz2
|
|
|
|
|
binary+Fl //....rar
|
|
|
|
|
binary+Fl //....gz
|
|
|
|
|
binary+Fl //....avi
|
|
|
|
|
binary+Fl //....jpg
|
|
|
|
|
binary+Fl //....jpeg
|
|
|
|
|
binary+Fl //....mpg
|
|
|
|
|
binary+Fl //....gif
|
|
|
|
|
binary+Fl //....tif
|
|
|
|
|
binary+Fl //....mov
|
|
|
|
|
binary+Fl //....jar
|
|
|
|
|
binary+l //....ico
|
|
|
|
|
binary+l //....exp
|
|
|
|
|
binary+l //....btr
|
|
|
|
|
binary+l //....bmp
|
|
|
|
|
binary+l //....doc
|
|
|
|
|
binary+l //....dot
|
|
|
|
|
binary+l //....xls
|
|
|
|
|
binary+l //....ppt
|
|
|
|
|
binary+l //....pdf
|
|
|
|
|
binary+l //....tar
|
|
|
|
|
binary+l //....exe
|
|
|
|
|
binary+l //....dll
|
|
|
|
|
binary+l //....lib
|
|
|
|
|
binary+l //....bin
|
|
|
|
|
binary+l //....class
|
|
|
|
|
binary+l //....war
|
|
|
|
|
binary+l //....ear
|
|
|
|
|
binary+l //....so
|
|
|
|
|
binary+l //....rpt
|
|
|
|
|
binary+l //....cfm
|
|
|
|
|
binary+l //....ma
|
|
|
|
|
binary+l //....mb
|
|
|
|
|
binary+l //....pac
|
|
|
|
|
binary+l //....m4a
|
|
|
|
|
binary+l //....mp4
|
|
|
|
|
binary+l //....aac
|
|
|
|
|
binary+l //....wma
|
|
|
|
|
binary+l //....docx
|
|
|
|
|
binary+l //....pptx
|
|
|
|
|
binary+l //....xlsx
|
|
|
|
|
binary+l //....png
|
|
|
|
|
binary+l //....raw
|
|
|
|
|
binary+l //....odt
|
|
|
|
|
binary+l //....ods
|
|
|
|
|
binary+l //....odg
|
|
|
|
|
binary+l //....odp
|
|
|
|
|
binary+l //....otg
|
|
|
|
|
binary+l //....ots
|
|
|
|
|
binary+l //....ott
|
|
|
|
|
binary+l //....psd
|
|
|
|
|
binary+l //....sxw
|
|
|
|
|
binary+S2w //....exe
|
|
|
|
|
binary+S2w //....dll
|
|
|
|
|
binary+S2w //....lib
|
|
|
|
|
binary+S2w //....app
|
|
|
|
|
binary+S2w //....dylib
|
|
|
|
|
binary+S2w //....stub
|
|
|
|
|
binary+S2w //....ipa
|
|
|
|
|
binary //....bmp
|
|
|
|
|
text //....ini
|
|
|
|
|
text //....config
|
|
|
|
|
text //....cpp
|
|
|
|
|
text //....h
|
|
|
|
|
text //....c
|
|
|
|
|
text //....cs
|
|
|
|
|
text //....m
|
|
|
|
|
text //....mm
|
|
|
|
|
text //....py
|
|
|
|
|
binary+l //....uasset
|
|
|
|
|
binary+l //....umap
|
|
|
|
|
binary+l //....upk
|
|
|
|
|
binary+l //....udk
|
|
|
|
|
binary+w //....exe
|
|
|
|
|
binary+w //....dll
|
|
|
|
|
binary+w //....lib
|
|
|
|
|
binary+w //....app
|
|
|
|
|
binary+w //....dylib
|
|
|
|
|
binary+w //....stub
|
|
|
|
|
binary+w //....ipa
|
|
|
|
|
binary //....bmp
|
|
|
|
|
text //....ini
|
|
|
|
|
text+w //....config
|
|
|
|
|
text //....cpp
|
|
|
|
|
text //....h
|
|
|
|
|
text //....c
|
|
|
|
|
text //....cs
|
|
|
|
|
text //....m
|
|
|
|
|
text //....mm
|
|
|
|
|
text //....py
|
|
|
|
|
binary+l //....uasset
|
|
|
|
|
binary+l //....umap
|
|
|
|
|
binary+l //....upk
|
|
|
|
|
binary+l //....udk
|
|
|
|
|
binary+l //....ubulk
|
|
|
|
|
text //....ignore
|
|
|
|
|
```
|
|
|
|
|
|
2023-06-29 11:55:02 +08:00
|
|
|
|
## 相关概念
|
|
|
|
|
### Workspace
|
|
|
|
|
Workspace可以理解为,depot到本地的一个映射,对应本地的一个目录。
|
|
|
|
|
新建Workspace,在p4admin中depot查看在服务器中存放的所有Ddepot仓库
|
|
|
|
|
|
2024-05-07 10:57:46 +08:00
|
|
|
|
开发的过程中可以有多个Workspace(例如一个用来开发,一个用来更新验证保证提交没有错误),但一般只推荐有一个Workspace。
|
|
|
|
|
|
|
|
|
|
### P4ExcludeList
|
|
|
|
|
|
|
|
|
|
### .p4ignore
|
|
|
|
|
命令行
|
|
|
|
|
```bash
|
|
|
|
|
p4 set P4IGNORE=.p4ignore
|
|
|
|
|
p4 ignores
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```text
|
|
|
|
|
# Ignore project files in the root
|
|
|
|
|
*.sln
|
|
|
|
|
!*\*.sln
|
|
|
|
|
.vs
|
|
|
|
|
*.suo
|
|
|
|
|
*.opensdf
|
|
|
|
|
*.sdf
|
|
|
|
|
*.pdb
|
|
|
|
|
*-Debug.dll
|
|
|
|
|
*.xcodeproj
|
|
|
|
|
.\Makefile
|
|
|
|
|
.\CMakeLists.txt
|
|
|
|
|
.\.ue4dependencies
|
|
|
|
|
|
|
|
|
|
ipch\*
|
|
|
|
|
|
|
|
|
|
# Packaged engine builds
|
|
|
|
|
LocalBuilds\*
|
|
|
|
|
|
|
|
|
|
# DDC should never be checked in
|
|
|
|
|
Engine\DerivedDataCache\*
|
|
|
|
|
Templates\**\DerivedDataCache\*
|
|
|
|
|
|
|
|
|
|
# Engine intermediates & binaries
|
|
|
|
|
Engine\Intermediate\*
|
|
|
|
|
Engine\Plugins\**\Intermediate\*
|
|
|
|
|
Engine\Programs\**\Intermediate\*
|
|
|
|
|
Engine\Binaries*
|
|
|
|
|
Engine\Plugins\**\Binaries\*
|
|
|
|
|
|
|
|
|
|
# Feature Packs (they might get updated with langauge packs?)
|
|
|
|
|
FeaturePacks\*
|
|
|
|
|
|
|
|
|
|
# Samples & Templates
|
|
|
|
|
Templates\**\Intermediate\*
|
|
|
|
|
Templates\**\Saved\*
|
|
|
|
|
Samples\**\Intermediate\*
|
|
|
|
|
|
|
|
|
|
# C# Intermediate folders
|
|
|
|
|
Engine\Source\Programs\**\obj\*
|
|
|
|
|
Engine\Platforms\**\Programs\**\obj\*
|
|
|
|
|
|
|
|
|
|
# Saved folders for programs should not be checked in
|
|
|
|
|
Engine\Programs\**\Saved\*
|
|
|
|
|
Engine\Programs\UnrealBuildTool\*
|
|
|
|
|
|
|
|
|
|
# Ignore any saved local files
|
|
|
|
|
Engine\Saved\*
|
|
|
|
|
|
|
|
|
|
# Ignore any build receipts
|
|
|
|
|
Engine\Build\Receipts\*
|
|
|
|
|
|
|
|
|
|
# Ignore Unix backup files
|
|
|
|
|
*~
|
|
|
|
|
|
|
|
|
|
# Ignore Mac desktop services store files
|
|
|
|
|
.DS_Store
|
|
|
|
|
|
|
|
|
|
# Ignore crash reports
|
|
|
|
|
crashinfo--*
|
|
|
|
|
|
|
|
|
|
# Ignore linux project files
|
|
|
|
|
*.user
|
|
|
|
|
*.pro
|
|
|
|
|
*.pri
|
|
|
|
|
*.kdev4
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Setup.bat Ignores
|
|
|
|
|
#
|
|
|
|
|
# There already might be some files pushed into the repo that would otherwise be
|
|
|
|
|
# filtered: those are from the initial commit, coming directly from UE4-GitHub.
|
|
|
|
|
# After running Setup.bat, the folders below will be populated with ~46GB of
|
|
|
|
|
# files. Hence we'll be blanked ignoring some directories such as ThirdParty,
|
|
|
|
|
# Media, Content, etc. If we want to change anything in those blanked-ignored
|
|
|
|
|
# folders, we should unignore the specific thing we're adding.
|
|
|
|
|
#
|
|
|
|
|
.git\*
|
|
|
|
|
Samples\**\Content\*
|
|
|
|
|
Samples\**\Media\*
|
|
|
|
|
Templates\**\Content\*
|
|
|
|
|
Templates\**\Media\*
|
|
|
|
|
Templates\Media\*
|
|
|
|
|
Engine\Platforms\**\Content\*
|
|
|
|
|
Engine\Documentation\*
|
|
|
|
|
Engine\Extras\*
|
|
|
|
|
Engine\Content\*
|
|
|
|
|
Engine\Build\*
|
|
|
|
|
Engine\Source\ThirdParty\*
|
|
|
|
|
Engine\Source\Programs\*
|
|
|
|
|
Engine\Source\Developer\*
|
|
|
|
|
Engine\Plugins\*
|
|
|
|
|
|
|
|
|
|
# Specific files
|
|
|
|
|
Engine\Config\ShaderCategories.csv
|
|
|
|
|
.tgitconfig
|
|
|
|
|
.ue4dependencies
|
|
|
|
|
|
|
|
|
|
# After all this above, there's still a couple folders and files left that doesn't
|
|
|
|
|
# fit the filtering criteria above, so we handle them individually here.
|
|
|
|
|
Engine\Source\Runtime\Navmesh\RecastDemo*
|
|
|
|
|
Engine\Source\Runtime\Launch\Resources\Mac*
|
|
|
|
|
Engine\Source\Runtime\Launch\Resources\Linux*
|
|
|
|
|
Engine\Source\Runtime\Experimental\Voronoi\Private\voro++*
|
|
|
|
|
|
|
|
|
|
Engine\Source\Runtime\Apple\MetalRHI\Public\ue4_stdlib.metal
|
|
|
|
|
Engine\Source\Runtime\AVEncoder\Private\Microsoft\Windows\ThirdParty\NvEncoder\LicenseAgreement.pdf
|
|
|
|
|
Engine\Source\Runtime\Experimental\Chaos\.clang-format
|
|
|
|
|
Engine\Source\Runtime\TraceLog\Private\Trace\LZ4\Epic.patch
|
|
|
|
|
Templates\TemplateResources\Standard\*.FBX
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# PLUGINS
|
|
|
|
|
#
|
|
|
|
|
# Plugins that come with Setup.bat are ignored above altogether, so we un-ignore
|
|
|
|
|
# the custom plugins we want to ship with the customized UE4.
|
|
|
|
|
!Engine\Plugins\Marketplace*
|
|
|
|
|
!Engine\Plugins\Runtime\HoudiniEngine*
|
|
|
|
|
# ... but keep ignoring their Build & Intermediate
|
|
|
|
|
Engine\Plugins\Marketplace\**\Intermediate\*
|
|
|
|
|
Engine\Plugins\Marketplace\**\Binaries\*
|
|
|
|
|
Engine\Plugins\Runtime\**\Intermediate\*
|
|
|
|
|
Engine\Plugins\Runtime\**\Binaries\*
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# PackageEngine.bat Ignores
|
|
|
|
|
#
|
|
|
|
|
# Packaging the engine will generate some .ini files which are safe to ignore
|
|
|
|
|
#
|
|
|
|
|
Samples\**\Saved\*
|
|
|
|
|
```
|
2023-06-29 11:55:02 +08:00
|
|
|
|
|
2024-05-06 16:50:58 +08:00
|
|
|
|
# ASoul P4设计
|
|
|
|
|
仓库:
|
|
|
|
|
1. 导播台。
|
|
|
|
|
2. 源文件。
|
|
|
|
|
|
|
|
|
|
分支:
|
|
|
|
|
1. 开发分支
|
|
|
|
|
2. 稳定分支
|