简体   繁体   中英

Setup Spring app on the deploy

Is this a good practice to use CommandLineRunner to setup app on the first deploy. For example, I want to:

  1. Create user's roles in the DB;
  2. Load admin's login and pass from property file and create admin-user (on user per app) in the DB.

Or can you advise a better variant for me?

I would not recommend doing it that way. Database setup, as well as future migrations, are handled nicely with either Flyway or Liquibase .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM