Closed mthiele closed 4 years ago
I fear that such a preconditions evaluation:
changes:
- precondition: ${E2E} == 'true'
- addUser:
name: e2e
- updateUser:
...
Will take a while to implement. As far as i know there is no simple library that provides such features. My proposal would be to implement an enabled flag either per action or for the whole changeset. This enabled flag can than be set through parameter substitution allowing a dynamic toggle of changes.
id: initial-keycloak
author: klg71
realm: master
enabled: ${INTIAL_KEYCLOAK_ENABLED} # Either here
changes:
- addUser:
actionEnabled: ${INTIAL_KEYCLOAK_ENABLED} # or per action
name: test
enabled: true
emailVerified: true
attributes:
test:
- test
- test2
...
@mthiele can you review the proposed solution?
Code and solution looks good to me. Please merge.
Reopen because it is not released yet
Released with version 0.1.31. Thanks for the issue @mthiele and code provided @sideisra! Will close this if no further requests occur.
I would like to propose an addition to the changeset specification to allow changes to be only executed if a certain criteria/precondition is met. Something similar can be found in Liquibase (https://docs.liquibase.com/concepts/advanced/preconditions.html). A simpler version would be sufficient.
My scenario: I want to create a user for end-to-end tests that should not be present in the migration for the keycloak that will run in production. Thus, something like this would suffice: