Use environment variables instead of server.ini by default #74
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello !
In Quackster/Kepler#72, @emansom asked about reading environment variables instead of
server.ini
by default.I'm not a Java developer at all, so i did what i can, you are free to give me some advices ! 😄
In the first place, i removed
entrypoint.sh
, that was used to take env variables to configureserver.ini
.After that, i have update the way that Kepler get configuration values.
Instead of just look into
server.ini
, it will first look in environment variables.If a value exists in environment, it will take it, if not, we continue what we were doing with
server.ini
.Note that variables keys are formated with conventionnal naming of environment variables, so uppercase with underscores.
So if we want to configure
server.port
we need to useSERVER_PORT
.NOW THE BAD NEWS
One of the Kepler configuration key is
mysql.username
, so with environment variables it should beMYSQL_USERNAME
.The problem is, using Kepler with Docker, we also use a MariaDB container.
This MariaDB container uses
MYSQL_USER
.So if we want to configure our Kepler with Docker & environment variables, we will have this in our .env file :
That's why the last commit changes all
mysql.username
tomysql.user
.I would be happy to know your opinions on that.
PS : Sorry @emansom, since i'm not confortable with Java, Gradle etc... I don't really know how to use jib and stuff.