Reputation: 2453
I have set environment properties in elasticbeanstalk, Property Name: spring.profiles.active
, Property Value: qa
.
On spring application deploy this value is correctly read by using ps -aef | grep tomcat
from terminal.
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.
Is this possible and if so, how do I do it.
Upvotes: 9
Views: 795
Reputation: 2453
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
Upvotes: 5