use of com.google.cloud.tools.intellij.appengine.cloud.AppEngineServerConfiguration in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineFlexibleSupportProvider method setupDeploymentRunConfiguration.
private static void setupDeploymentRunConfiguration(Module module) {
RunManager runManager = RunManager.getInstance(module.getProject());
if (!hasFlexibleDeploymentConfiguration(runManager.getAllConfigurationsList())) {
AppEngineCloudType serverType = ServerType.EP_NAME.findExtension(AppEngineCloudType.class);
DeployToServerConfigurationType configurationType = DeployToServerConfigurationTypesRegistrar.getDeployConfigurationType(serverType);
RunnerAndConfigurationSettings settings = runManager.createRunConfiguration(configurationType.getDisplayName(), configurationType.getFactory());
// Sets the GAE Flex server, if any exists, in the run config.
DeployToServerRunConfiguration<?, AppEngineDeploymentConfiguration> runConfiguration = (DeployToServerRunConfiguration<?, AppEngineDeploymentConfiguration>) settings.getConfiguration();
RemoteServer<AppEngineServerConfiguration> server = ContainerUtil.getFirstItem(RemoteServersManager.getInstance().getServers(serverType));
if (server != null) {
runConfiguration.setServerName(server.getName());
}
runManager.addConfiguration(settings, false);
}
}
use of com.google.cloud.tools.intellij.appengine.cloud.AppEngineServerConfiguration in project google-cloud-intellij by GoogleCloudPlatform.
the class AppEngineStandardWebIntegration method setupDeployRunConfiguration.
private void setupDeployRunConfiguration(@NotNull Module module) {
RunManager runManager = RunManager.getInstance(module.getProject());
boolean hasExistingDeployConfiguration = runManager.getAllConfigurationsList().stream().filter(config -> config instanceof DeployToServerRunConfiguration).map(config -> ((DeployToServerRunConfiguration) config).getServerType()).anyMatch(serverType -> serverType instanceof AppEngineCloudType);
if (!hasExistingDeployConfiguration) {
AppEngineCloudType serverType = ServerType.EP_NAME.findExtension(AppEngineCloudType.class);
RemoteServer<AppEngineServerConfiguration> server = ContainerUtil.getFirstItem(RemoteServersManager.getInstance().getServers(serverType));
DeployToServerConfigurationType configurationType = DeployToServerConfigurationTypesRegistrar.getDeployConfigurationType(serverType);
ConfigurationFactoryEx factory = configurationType.getFactory();
RunnerAndConfigurationSettings settings = runManager.createRunConfiguration(configurationType.getDisplayName(), factory);
DeployToServerRunConfiguration<?, ?> runConfiguration = (DeployToServerRunConfiguration<?, ?>) settings.getConfiguration();
if (server != null) {
runConfiguration.setServerName(server.getName());
}
runManager.addConfiguration(settings, false);
}
}
Aggregations