且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将私有信息添加到 OpenShift 环境变量?

更新时间:2023-11-29 22:50:34

SSH 进入你的应用程序并导航到你的数据目录

SSH into you application and navigate to your data directory

cd app-root/data

在此目录中创建一个包含变量的文件(例如.myenv"),其内容类似于

in this directory create a file with your variables (e.g. ".myenv") with content like

export MY_VAR="something"

然后在您的存储库中的.openshift/action_hooks/pre_start"中添加这一行

and then in your repository in ".openshift/action_hooks/pre_start" add this line

source ${OPENSHIFT_DATA_DIR}/.myenv