--- 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/ && \ docker build -f /home/perforce/helix-docker/helix-p4d/Dockerfile -t helix-p4d:2023.5 . ``` docker build --file ./helix-p4d/Dockerfile --tag helix-p4d:2023.7 . ## 使用 ```shell docker run -d --name helix-p4d\ -p 1666:1666 \ -v /home/perforce/p4:/p4 \ helix-p4d:2023.5 ``` ```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 ```text docker tag 9f45f31246ac blueroses/perforce-helix-p4d:2023.5 docker push blueroses/perforce-helix-p4d:2023.5 ``` # 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) 编码使用:UTF8-no bom - 注册源码引擎到EpicGames 经过上面的步骤,源码引擎已经构建成功,但是在对项目就行选择引擎版本的时候,发现并没有这个版本 。这是因为,构建的引擎没有注册到EpicGames中,找到EpicGames安装目录下的注册器。复制到源码工程并且运行即可。 ```text Launcher\Engine\Binaries\Win64 ``` # 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/p4guide/Content/P4Guide/Home-p4guide.html - https://www.perforce.com/manuals/p4sag/Content/P4SAG/Home-p4sag.html - https://www.perforce.com/manuals/p4admin/Content/P4Admin/Home-p4admin.html ## 相关概念 ### Workspace Workspace可以理解为,depot到本地的一个映射,对应本地的一个目录。 新建Workspace,在p4admin中depot查看在服务器中存放的所有Ddepot仓库 开发的过程中可以有多个Workspace(例如一个用来开发,一个用来更新验证保证提交没有错误),但一般只推荐有一个Workspace ###