这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jkutner
Copy link
Contributor

@jkutner jkutner commented Sep 6, 2018

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 release command to the Procfile. Heroku treats the release process 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

  • Apply this same improvement for Gradle
  • Possibly pply a similar improvement for JAR deploys (this is a bit more complicated because the Maven plugin isn't present on the server)

@jkutner jkutner changed the title [heroku] move Liquibase migrations to release process [heroku] move Liquibase migrations to release phase Sep 6, 2018
@atomfrede
Copy link
Member

For gradle you basically need a liquibase configuration, right? So something like gradlew liquibaseHerokuUpdate? Or do you have another idea already?

@jdubois
Copy link
Member

jdubois commented Sep 6, 2018

What an incredibly good idea @jkutner !!! That's truly awesome!

@jdubois jdubois merged commit d146395 into jhipster:master Sep 6, 2018
@jkutner
Copy link
Contributor Author

jkutner commented Sep 6, 2018

@atomfrede that sounds right. I'm not as familiar with the Gradle liquibase plugin though.

@atomfrede
Copy link
Member

@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.

@jdubois
Copy link
Member

jdubois commented Sep 6, 2018

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!!

@jkutner
Copy link
Contributor Author

jkutner commented Sep 6, 2018

@atomfrede i think this could go in the heroku.gradle.ejs. would love the help, let me know if i can assist.

@atomfrede
Copy link
Member

atomfrede commented Sep 6, 2018

@jkutner Some questions. Currently the heroku gradle plugin is added in version 0.2.0. Somehow I can only use the new version when using the new plugins section not in the classpath section (but will try it later again) (Stupid me, forget what I wrote). Can/should we update it?

Furthermore is the plugin still required? Deploy Gradle based JVM applications directly to Heroku without pushing to a Git repository. When we want to use git deploy only?

Regarding liquibase I think it can easily be added to heroku.gradle

@jkutner
Copy link
Contributor Author

jkutner commented Sep 6, 2018

@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&amp;hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy</referenceUrl>
Copy link
Member

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%>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yea, good catch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with #8239

@jdubois jdubois added this to the 5.3.2 milestone Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants