-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[heroku] move Liquibase migrations to release phase #8229
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
Conversation
|
For gradle you basically need a liquibase configuration, right? So something like |
|
What an incredibly good idea @jkutner !!! That's truly awesome! |
|
@atomfrede that sounds right. I'm not as familiar with the Gradle liquibase plugin though. |
|
@jkutner I hope I find some time during the weekend to implement it. The question is if we need a needle for that or just create a new gradle script for that. Will think about it. |
|
This works incredibly well -> I used to have frequent timeouts, so boot up time was often over 90 seconds. I just did one test, and it booted in 21 secondes!! |
|
@atomfrede i think this could go in the heroku.gradle.ejs. would love the help, let me know if i can assist. |
|
@jkutner Some questions. Currently the heroku gradle plugin is added in version Furthermore is the plugin still required? Regarding liquibase I think it can easily be added to |
|
@atomfrede i'm not sure why the heroku-gradle plugin is added. it might be for the CI/CD generator, but it's not used for the JAR and Git deployment. I would say ignore it, or remove it if possible. |
| <defaultSchemaName></defaultSchemaName> | ||
| <username>${env.JDBC_DATABASE_USERNAME}</username> | ||
| <password>${env.JDBC_DATABASE_PASSWORD}</password> | ||
| <referenceUrl>hibernate:spring:com.mycompany.myapp.domain?hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy</referenceUrl> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if required, but I think the package should be a variable: <%=packageName%>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yea, good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with #8239
The change disabled liquibase migrations from running inline with the web process, and moves them to the Heroku Release phase. This will significantly improve startup time, and prevents common problems related to concurrency (i.e. migrations running on more than one server process at the same time).
In more detail, this will add special Liquibase configuration to the Maven profile, and a
releasecommand to theProcfile. Heroku treats thereleaseprocess type specially, and runs it when appropriate (i.e. after a deploy, or when a new database is attached).The change only affects Git deploy (which will eventually become the default deploy mechanism for this generator).
NOTE: This PR includes the changes from #8225 because they were require to get this working. We can choose to close that PR and merge this one, or I can rebase.
Future work