如何阅读AWS ElasticBeanstalk中设置的环境属性

时间:2022-01-03 23:50:05

I have set environment properties in elasticbeanstalk, Property Name: spring.profiles.active, Property Value: qa.

我在elasticbeanstalk中设置了环境属性,属性名称:spring.profiles.active,属性值:qa。

如何阅读AWS ElasticBeanstalk中设置的环境属性

On spring application deploy this value is correctly read by using ps -aef | grep tomcat from terminal.

在Spring应用程序部署中,使用ps -aef |正确读取此值来自终端的grep tomcat。

如何阅读AWS ElasticBeanstalk中设置的环境属性

I want to be able to read this environment property in a shell script and extract the value "qa" which I use to configure other items on the server.

我希望能够在shell脚本中读取此环境属性并提取值“qa”,我用它来配置服务器上的其他项目。

Is this possible and if so, how do I do it.

这是可能的,如果是这样,我该怎么做。

1 个解决方案

#1


5  

OK I found out how to get the result I was looking for.

好的,我发现了如何获得我想要的结果。

Here is the command:

这是命令:

ps -aef | grep tomcat | grep -Po 'spring.profiles.active=\K[^ ]+'

If someone has a cleaner or better way of doing this I will gladly accept it.

如果某人有更清洁或更好的方法,我会很乐意接受它。

G

G

#1


5  

OK I found out how to get the result I was looking for.

好的,我发现了如何获得我想要的结果。

Here is the command:

这是命令:

ps -aef | grep tomcat | grep -Po 'spring.profiles.active=\K[^ ]+'

If someone has a cleaner or better way of doing this I will gladly accept it.

如果某人有更清洁或更好的方法,我会很乐意接受它。

G

G