use of com.intellij.remoteServer.configuration.RemoteServer in project intellij-community by JetBrains.
the class CloudModuleBuilderSourceContribution method configureModule.
@Override
public void configureModule(final Module module) {
final CloudModuleBuilder moduleBuilder = getModuleBuilder();
RemoteServer<SC> account = (RemoteServer<SC>) moduleBuilder.getAccount();
final AC applicationConfiguration = (AC) moduleBuilder.getApplicationConfiguration();
DC deploymentConfiguration = createDeploymentConfiguration();
if (applicationConfiguration.isExisting()) {
deploymentConfiguration.setDefaultDeploymentName(false);
deploymentConfiguration.setDeploymentName(applicationConfiguration.getExistingAppName());
}
final DeployToServerRunConfiguration<SC, DC> runConfiguration = CloudRunConfigurationUtil.createRunConfiguration(account, module, deploymentConfiguration);
final ServerType<?> cloudType = account.getType();
final Project project = module.getProject();
new CloudConnectionTask<Object, SC, DC, SR>(project, CloudBundle.getText("cloud.support", cloudType.getPresentableName()), account) {
boolean myFirstAttempt = true;
@Override
protected Object run(SR serverRuntime) throws ServerRuntimeException {
doConfigureModule(applicationConfiguration, runConfiguration, myFirstAttempt, serverRuntime);
return null;
}
@Override
protected void runtimeErrorOccurred(@NotNull String errorMessage) {
myFirstAttempt = false;
new SshKeyChecker().checkServerError(errorMessage, getNotifier(), project, this);
}
@Override
protected void postPerform(Object result) {
detectModuleStructure(module, moduleBuilder.getContentEntryPath());
}
@Override
protected boolean shouldStartInBackground() {
return false;
}
}.performAsync();
}
use of com.intellij.remoteServer.configuration.RemoteServer in project intellij-community by JetBrains.
the class UploadApplicationAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
final Project project = e.getRequiredData(CommonDataKeys.PROJECT);
RunnerAndConfigurationSettings configurationToRun = getConfigurationToRun(project);
if (configurationToRun != null) {
ProgramRunnerUtil.executeConfiguration(project, configurationToRun, DefaultRunExecutor.getRunExecutorInstance());
} else {
AppEngineCloudType serverType = AppEngineCloudType.getInstance();
List<RemoteServer<AppEngineServerConfiguration>> servers = RemoteServersManager.getInstance().getServers(serverType);
DeploymentConfigurationManager.getInstance(project).createAndRunConfiguration(serverType, ContainerUtil.getFirstItem(servers));
}
}
use of com.intellij.remoteServer.configuration.RemoteServer 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