forked from Archives/Athou_commafeed
re-add dropwizard-migrations to be able to use liquibase from command line
This commit is contained in:
@@ -261,8 +261,8 @@
|
|||||||
<artifactId>dropwizard-hibernate</artifactId>
|
<artifactId>dropwizard-hibernate</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.liquibase</groupId>
|
<groupId>io.dropwizard</groupId>
|
||||||
<artifactId>liquibase-core</artifactId>
|
<artifactId>dropwizard-migrations</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.dropwizard</groupId>
|
<groupId>io.dropwizard</groupId>
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ import io.dropwizard.assets.AssetsBundle;
|
|||||||
import io.dropwizard.db.DataSourceFactory;
|
import io.dropwizard.db.DataSourceFactory;
|
||||||
import io.dropwizard.forms.MultiPartBundle;
|
import io.dropwizard.forms.MultiPartBundle;
|
||||||
import io.dropwizard.hibernate.HibernateBundle;
|
import io.dropwizard.hibernate.HibernateBundle;
|
||||||
|
import io.dropwizard.migrations.MigrationsBundle;
|
||||||
import io.dropwizard.server.DefaultServerFactory;
|
import io.dropwizard.server.DefaultServerFactory;
|
||||||
import io.dropwizard.servlets.CacheBustingFilter;
|
import io.dropwizard.servlets.CacheBustingFilter;
|
||||||
import io.dropwizard.setup.Bootstrap;
|
import io.dropwizard.setup.Bootstrap;
|
||||||
@@ -107,6 +108,13 @@ public class CommaFeedApplication extends Application<CommaFeedConfiguration> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
bootstrap.addBundle(new MigrationsBundle<CommaFeedConfiguration>() {
|
||||||
|
@Override
|
||||||
|
public DataSourceFactory getDataSourceFactory(CommaFeedConfiguration configuration) {
|
||||||
|
return configuration.getDataSourceFactory();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
bootstrap.addBundle(new AssetsBundle("/assets/", "/", "index.html"));
|
bootstrap.addBundle(new AssetsBundle("/assets/", "/", "index.html"));
|
||||||
bootstrap.addBundle(new MultiPartBundle());
|
bootstrap.addBundle(new MultiPartBundle());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,18 +45,14 @@ public class CommaFeedConfiguration extends Configuration {
|
|||||||
@JsonProperty("app")
|
@JsonProperty("app")
|
||||||
private ApplicationSettings applicationSettings;
|
private ApplicationSettings applicationSettings;
|
||||||
|
|
||||||
private final ResourceBundle bundle;
|
private final String version;
|
||||||
|
private final String gitCommit;
|
||||||
|
|
||||||
public CommaFeedConfiguration() {
|
public CommaFeedConfiguration() {
|
||||||
bundle = ResourceBundle.getBundle("application");
|
ResourceBundle bundle = ResourceBundle.getBundle("application");
|
||||||
}
|
|
||||||
|
|
||||||
public String getVersion() {
|
this.version = bundle.getString("version");
|
||||||
return bundle.getString("version");
|
this.gitCommit = bundle.getString("git.commit");
|
||||||
}
|
|
||||||
|
|
||||||
public String getGitCommit() {
|
|
||||||
return bundle.getString("git.commit");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
|||||||
Reference in New Issue
Block a user