Thanks for your inputs, I made changes to get it working with both system
properties and environment variables.
Just one last question before sending the pull request, are you sure about
failing the test if the environment does not contain HOME or HOMEPATH ?
On Thu, Sep 19, 2019 at 10:00 AM Stian Thorgersen <sthorger(a)redhat.com>
I didn't think about containers. You're right it makes it
with containers. I guess env variables would be best, but would need to
figure out how to test in that case. Maven wouldn't work as we are able to
run tests from IDE as well with an embedded Keycloak server.
Here's my suggestion. In theme.properties allow:
Before loading theme properties create a new properties instance, load it
with system properties as well as environment values (where env variables
are prefixed with env.).
In the theme.properties add properties for default env variables on
different OS. Like so:
Then you can check the properties with a runOnServer job rather than with
a custom template. Something along the lines of (pseudo code, not
Theme t = ...
else if ....
assert.fail("No default env variable found, can't verify"));
On Tue, 17 Sep 2019 at 16:21, Vincent Letarouilly <
> Ok I got it working with system properties and it is indeed much simpler
> to test (
> However it is not clear to me how will I inject system properties when
> running Keycloak inside the official docker container.
> Do you know if I need to override the entrypoint and add some arguments ?
> From what I can see everything given in argument to the
> *docker-entrypoint.sh* will be passed to *standalone.sh* script and will
> end up being passed to the java command with *$SERVER_OPTS* variable.
> Is that correct or is there a simpler solution ?
> Best regards
> On Tue, Sep 17, 2019 at 11:15 AM Stian Thorgersen <sthorger(a)redhat.com>
>> A simpler option may just be to allow system properties as that would be
>> much simpler to test.
>> On Tue, 17 Sep 2019 at 10:45, Vincent Letarouilly <
>> vincent.letarouilly(a)gmail.com> wrote:
>>> Hello everyone,
>>> I started some development on a closed ticket (
) in order to add the
>>> to load environment variables through theme.properties for custom
>>> I'd need some feedback from you to see if I'm taking the right path
>>> here as
>>> this is my first Keycloak dev and I'm not an expert in Java nor Maven.
>>> This is what I've done so far
>>> I'm quite unhappy with the duplication of the maven-surefire-plugin (you
>>> can see that on top of my plugin block, there's an existing
>>> maven-surefire-plugin plugin block) but I did not found other way to
>>> an environment variable into the test context.
>>> If someone could give me some feedback here it'd be very much
>>> appreciated :)
>>> keycloak-dev mailing list