Created
February 25, 2018 17:18
-
-
Save alessandrobologna/4cb81899636d9b523b6eecf491b3510c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" = "run" ] | |
then | |
RUN_FLAGS="" | |
case $STAGE in | |
dev) | |
# set flags for dev enviroment | |
RUN_FLAGS="-Dspring.profiles.active=dev -Dcom.example.mock=local" | |
;; | |
qa) | |
# set flags for dev enviroment | |
RUN_FLAGS="-Dspring.profiles.active=qa -Dcom.example.mock=qa.db" | |
;; | |
prod) | |
# set flags for dev enviroment | |
RUN_FLAGS="-Dspring.profiles.active=prod -Dcom.example.mock=prod.db" | |
;; | |
*) | |
echo "STAGE needs to be defined" | |
exit 1 | |
;; | |
esac | |
echo "Executing with runtime flags $RUN_FLAGS" | |
exec java $RUN_FLAGS -jar /app/application.jar | |
else | |
exec $@ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment