Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -368,22 +368,25 @@ private boolean createApplicationIfNeeded(CloudFoundryClient client, BuildListen
}
}

Staging staging = new Staging(deploymentInfo.getCommand(), deploymentInfo.getBuildpack(),
deploymentInfo.getStack(), deploymentInfo.getTimeout());

// Create app if it doesn't exist
if (createNewApp) {
listener.getLogger().println("Creating new app.");
String stack = deploymentInfo.getStack();
if (stack != null && client.getStack(stack) == null) {
throw new IllegalArgumentException("Stack " + stack + " does not exist on the target.");
}
Staging staging = new Staging(deploymentInfo.getCommand(), deploymentInfo.getBuildpack(),
deploymentInfo.getStack(), deploymentInfo.getTimeout());
List<String> uris = new ArrayList<String>();
// Pass an empty List as the uri list if no-route is set
if (!deploymentInfo.isNoRoute()) {
uris.add(appURI);
}
List<String> services = deploymentInfo.getServicesNames();
client.createApplication(deploymentInfo.getAppName(), staging, deploymentInfo.getMemory(), uris, services);
} else {
client.updateApplicationStaging(deploymentInfo.getAppName(), staging);
}

return createNewApp;
Expand Down