set-env PATH in Openshift

会有一股神秘感。 提交于 2019-12-02 06:54:13

问题


I'm using a pre_start action hook to add some new paths to the PATH and LD_LIBRARY_PATH environment.

after git push I can see that variables are updated, however when I ssh to the server, added variables are not available, after some googling I found out this is happening because these variables are exported as a sub-shell.

openshift documentations suggest to add variables using set-env command, but when run it I get following error

rhc set-env PATH=$OPENSHIFT_DATA_DIR/bin:$PATH" -a srv
Setting environment variable(s) ... PATH cannot be overridden

Does anybody know how we can overcome this?


回答1:


If I'm guessing correctly at what you're ultimately trying to accomplish, your trying to write your own cartridge. Recently we just added a new environment variable OPENSHIFT_yourcartname_LD_LIBRARY_PATH_ELEMENT. You can use this environment variable to configure the location of each cartridge's library files



来源:https://stackoverflow.com/questions/22720952/set-env-path-in-openshift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!