2022-05-18 13:45:24 +02:00
|
|
|
package eu.eudat.migration;
|
|
|
|
|
|
|
|
import eu.eudat.migration.services.DMPRoadmapService;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
|
2022-05-30 10:11:28 +02:00
|
|
|
import org.springframework.context.ConfigurableApplicationContext;
|
2022-05-18 13:45:24 +02:00
|
|
|
|
|
|
|
@SpringBootApplication(
|
2022-05-30 10:11:28 +02:00
|
|
|
scanBasePackages = "eu.eudat"
|
2022-05-18 13:45:24 +02:00
|
|
|
)
|
|
|
|
@ConfigurationPropertiesScan("eu.eudat.migration.properties")
|
|
|
|
public class DMPRoadmapMigration implements CommandLineRunner {
|
|
|
|
|
|
|
|
private final DMPRoadmapService service;
|
2022-05-30 10:11:28 +02:00
|
|
|
private static ConfigurableApplicationContext context;
|
2022-05-18 13:45:24 +02:00
|
|
|
|
|
|
|
@Autowired
|
|
|
|
public DMPRoadmapMigration(DMPRoadmapService service) {
|
|
|
|
this.service = service;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
2022-05-30 10:11:28 +02:00
|
|
|
context = new SpringApplicationBuilder(DMPRoadmapMigration.class).run(args);
|
|
|
|
context.close();
|
2022-05-18 13:45:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void run(String... args) throws Exception {
|
2022-05-30 10:11:28 +02:00
|
|
|
this.service.migrateUsers();
|
2022-05-18 13:45:24 +02:00
|
|
|
this.service.migrate();
|
|
|
|
}
|
|
|
|
}
|