OpenShift 迁移 - 如何处理 .openshift 文件夹?

OpenShift Migration - What To Do About .openshift Folder?

由于 OpenShift 2 即将停用,许多 companies/people 正在将他们的 OpenShift v2 应用程序迁移到 OpenShift Pro

OpenShift v2 文件夹 .openshift 不再包含在 OpenShift Pro 中,RedHat 的迁移文档实际上指出它应该是 删除.

但是,如果您实际使用了 .openshift 公开的功能(例如 Tomcat 设置)怎么办?例如 tomcat-users.xmlserver.xml.

我自己用过server.xml指定加法docBase.

<Context docBase="${OPENSHIFT_DATA_DIR}/documents" path="/documents" />

我该怎么办?

这在 OpenShift Pro 中是如何实现的?

是不是不能再做了?

是不是很讨厌?

现在我们是 付费客户,也许 RedHat(或其他地方)的人可以启发我们...

document有答案(没试过):

  1. All WAR files from the deployments source repository directory are copied to /opt/webserver/webapps.

  2. All files in the configuration source repository directory are copied to /opt/webserver/conf.

If you want to use custom Tomcat configuration files, the file names should be the same as for a normal Tomcat installation. For example, context.xml and server.xml.

尝试通过 oc rhc <pod_id> 登录 pod shell 并探索 /opt/webserver/conf 区域。

编辑 1 -

每次部署都会重建服务器,对 server.xml 的更改将会丢失。因此,所有配置文件都应该是创建映像的存储库的一部分。

如果您正在使用 maven build 并且想要像 server.xml 这样的配置文件的自定义部署,请检查 this article

示例 POM given here

编辑 2

@Lyndon 在评论中建议的另一种更简单的方法

All you need to do is create a folder called configuration under the top level git folder. Any file you put in there will get copied to: /opt/webserver/conf. It really is that simple.