This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM busybox | |
# any thing after here will not be cached | |
# since Quay.IO check out will results in a different timestamp to the cache | |
ADD .git/HEAD /app/CACHE_BUSTER | |
RUN rm CACHE_BUSTER |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.yaml.snakeyaml.DumperOptions | |
import org.yaml.snakeyaml.Yaml | |
apply plugin: 'groovy' | |
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configurations { | |
newrelic | |
} | |
dependencies { | |
newrelic "com.newrelic.agent.java:newrelic-agent:${newrelicVersion}" | |
} | |
task newrelicJar(type: Copy) { | |
from { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
errordeveloper/oracle-jre | |
WORKDIR /app/ | |
ADD app-config.yml /app/ | |
ADD build/app.jar /app/ | |
# port and run | |
EXPOSE 9090 | |
ENTRYPOINT [ "java" ] | |
CMD [ "-jar", "app.jar", "server", "app-config.yml" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Singleton | |
@javax.ws.rs.ext.Provider | |
public class NewRelicTimedApplicationListener implements ApplicationEventListener { | |
private Map<Method,String> methodMap = new HashMap<>(); | |
@Override | |
public void onEvent(ApplicationEvent event) { | |
if (event.getType() == ApplicationEvent.Type.INITIALIZATION_APP_FINISHED) { | |
for (Resource resource : event.getResourceModel().getResources()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MultiTenantDataSource implements ManagedDataSource { | |
private final ManagedDataSource managedDataSource; | |
private final SchemaResolver schemaResolver; | |
public MultiTenantDataSource( final ManagedDataSource managedDataSource, final SchemaResolver schemaResolver ) | |
{ | |
this.managedDataSource = managedDataSource; | |
this.schemaResolver = schemaResolver; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
publishing { | |
publications { | |
mavenJava(MavenPublication) { | |
pom.withXml { | |
asNode().dependencies.'*'.findAll() { | |
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep -> | |
dep.name == it.artifactId.text() | |
} | |
}.each() { | |
it.scope*.value = 'compile' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ApplicationConfiguration extends Configuration implements AssetsBundleConfiguration { | |
@Valid | |
@NotNull | |
@JsonProperty | |
private AssetsConfiguration assets; | |
@Override | |
public AssetsConfiguration getAssets() { | |
return assets; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void initialize( final Bootstrap<PlatformConfiguration> bootstrap ) { | |
final GuiceBundle<PlatformConfiguration> guiceBundle = GuiceBundle.<PlatformConfiguration>newBuilder() | |
.addModule( new PlatformModule() ) | |
.enableAutoConfig( "com.apmasphere.platform.resources", "com.apmasphere.platform.health" ) | |
.setConfigClass( PlatformConfiguration.class ) | |
.setInjectorFactory( new GovernatorInjectorFactory() ) | |
.build(); | |
bootstrap.addBundle( guiceBundle ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bridge all Guice injection from AppServletContextListener | |
GuiceBridge.getGuiceBridge().initializeGuiceBridge( serviceLocator ); | |
GuiceIntoHK2Bridge guiceBridge = serviceLocator.getService( GuiceIntoHK2Bridge.class ); | |
guiceBridge.bridgeGuiceInjector( injector ); |