Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read Environment Properties set in AWS ElasticBeanstalk

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

enter image description here

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

enter image description here

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.

like image 868
Gman Avatar asked Nov 11 '15 18:11

Gman


1 Answers

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

like image 196
Gman Avatar answered Oct 04 '22 14:10

Gman