-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow configuration of database URL in maven #242
Comments
Hi, we can take your use case a few ways:
I believe you are requesting option 3 in your issue. That should be no problem to do, but I wanted to list out the other options too just in case they fit your use case better. (we are looking to add a native Gradle API too in case that would help you). Let us know which you'd prefer to go with for your immediate use case. (We'd probably consider building option 3 anyway, as it is relatively simple to do) Regarding the deploy goal name, I'm open to adding a new name to execute the deploy (we will still keep the old name for backward compatibility) FYI, we can support a yaml representing of the configs as well (we do use it internally, but haven't documented it yet and there are a couple things I'd like to clean up, also mentioned in #102 ). If that is a big win for you, we can get that prioritized as well |
Yes that was my plan for the non maven side. Basically we have two things that do the deployment:
The second point requires cluster support. We use Postgresql and the canonical way to do this is an Advisory Lock (see postgresql documentation). Thus I could fork the project and add this specific code as mentioned in #111 but for it to be done truly correct requires some re-architecture. As for YAML support I don't care much for it. I think YAML is vastly overrated. I don't have a problem editing XML... even plain property files work for me. I much rather have point 2 fixed aka #111 then the configuration issues particularly because I can just use the Maven resource filter as a workaround (I think). |
Acknowledged; will take a look at #111 first and then we can come back to this |
Is this still a priority? It would be incredibly useful to provide DB username, password, hostname, and database name as variables in the It seems like this project has been very quiet for a few months. I hope it's still alive! |
I'm guessing this project has gone dark. I hope it's not forever. I did find a way to provide variable names to the Obevo system-config.xml file. You can use the resources plugin to move the database schema files to a temp folder in target/ and filter the system-config.xml file to contain the correct values. In the
In the POM, define some properties:
Note the Next, setup the resources plugin to read from
Finally, configure the Obevo plugin to use those files:
This should let you do migrations on databases based on runtime configs. Works on my machine! :P |
We are going to start actively working on this project. |
First let me just say I love the idea of this project and I had contemplated making something similar awhile back but it would have been a too much work. I may sound critical below but believe me I'm very much liking this project and appreciate the work.
That being said it would be nice if the
system-config.xml
interpolated properties or if there was an override of the JDBC URL for the Maven plugin (or in general).For example:
And in Maven or command line you would essentially do
-Dv2.database.url
(or<properties>
) passed in (this would also allow maven profile usage as well).The user and password are separated out why can't the host and port (aka url)?
Particularly the port as often times our developers will use docker or SSH tunnel (the host can easily be changed by adding an entry in /etc/hosts).
I suppose the work around for now that I will probably implement is to use the maven resources plugin and have the variable expanded on copy prior to running this plugins "deploy" goal.
Speaking of which the goal "deploy" is also extremely confusing as it conflicts with maven's goal of deploy which will actually deploy the jar.
Anyway to give you our use case(s):
Originally we were using Flyway (and we will probably go back to it) to migrate the database and then after that we used jOOQ to generate Java sources.
I understand the environments for enterprise like companies but we treat everything like its basically production. So environments literally makes no since to us.
The only difference between production, testing, staging etc is configuration which is pulled from a configuration server (and in some cases environment variables for bootstrapping). The
dbEnvironments
completely violates are practices as we do not ship environment specific code but I can see the need for others.The text was updated successfully, but these errors were encountered: