com.heroku.sdk.deploy.WarApp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of heroku-deploy Show documentation
Show all versions of heroku-deploy Show documentation
Library for deploying Java applications to Heroku
package com.heroku.sdk.deploy;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class WarApp extends App {
protected File warFile;
protected File webappRunnerJar;
public WarApp(String name) throws IOException {
super(name);
}
public WarApp(String buildPackDesc, String name, File warFile, File webappRunnerJar, File rootDir, File targetDir) {
super(buildPackDesc, name, rootDir, targetDir, new ArrayList());
this.warFile = warFile;
this.webappRunnerJar = webappRunnerJar;
}
public void deploy(List includedFiles, Map configVars, String jdkVersion, String stack, String slugFileName) throws Exception {
includedFiles.add(webappRunnerJar);
includedFiles.add(warFile);
super.deploy(includedFiles, configVars, jdkVersion, stack, defaultProcTypes(), slugFileName);
}
public void deploy(List includedFiles, Map configVars, URL jdkUrl, String stack, String slugFileName) throws Exception {
includedFiles.add(webappRunnerJar);
includedFiles.add(warFile);
super.deploy(includedFiles, configVars, jdkUrl, stack, defaultProcTypes(), slugFileName);
}
public void deploySlug(List includedFiles, Map configVars, String jdkVersion, String stack, String slugFileName) throws Exception {
includedFiles.add(webappRunnerJar);
includedFiles.add(warFile);
super.deploySlug(includedFiles, configVars, jdkVersion, stack, defaultProcTypes(), slugFileName);
}
public void deploySlug(List includedFiles, Map configVars, URL jdkUrl, String stack, String slugFileName) throws Exception {
includedFiles.add(webappRunnerJar);
includedFiles.add(warFile);
super.deploySlug(includedFiles, configVars, jdkUrl, stack, defaultProcTypes(), slugFileName);
}
protected Map defaultProcTypes() {
Map processTypes = new HashMap();
processTypes.put("web", "java $JAVA_OPTS -jar " + relativize(webappRunnerJar) + " $WEBAPP_RUNNER_OPTS --port $PORT " + relativize(warFile));
return processTypes;
}
}