use of com.microsoft.azure.toolkit.intellij.webapp.docker.pushimage.PushImageRunConfiguration in project azure-tools-for-java by Microsoft.
the class PushToContainerRegistryAction method openRunDialog.
private void openRunDialog(Project project, PrivateRegistryImageSetting imageSetting) {
final RunManagerEx manager = RunManagerEx.getInstanceEx(project);
final ConfigurationFactory factory = configType.getPushImageRunConfigurationFactory();
RunnerAndConfigurationSettings settings = manager.createConfiguration(String.format("%s: %s", factory.getName(), project.getName()), factory);
PushImageRunConfiguration conf = (PushImageRunConfiguration) settings.getConfiguration();
conf.setPrivateRegistryImageSetting(imageSetting);
openRunDialog(project, settings);
}
use of com.microsoft.azure.toolkit.intellij.webapp.docker.pushimage.PushImageRunConfiguration in project azure-tools-for-java by Microsoft.
the class PushToContainerRegistryAction method runConfiguration.
@SuppressWarnings({ "deprecation", "Duplicates" })
private void runConfiguration(@NotNull Project project) {
final RunManagerEx manager = RunManagerEx.getInstanceEx(project);
final ConfigurationFactory factory = configType.getPushImageRunConfigurationFactory();
RunnerAndConfigurationSettings settings = manager.findConfigurationByName(String.format("%s: %s", factory.getName(), project.getName()));
Observable.fromCallable(() -> {
Registry registry = ContainerRegistryMvpModel.getInstance().getContainerRegistry(currentNode.getSubscriptionId(), currentNode.getResourceId());
return ContainerRegistryMvpModel.getInstance().createImageSettingWithRegistry(registry);
}).subscribeOn(SchedulerProviderFactory.getInstance().getSchedulerProvider().io()).subscribe(ret -> {
if (settings != null) {
PushImageRunConfiguration conf = (PushImageRunConfiguration) settings.getConfiguration();
PrivateRegistryImageSetting imageSetting = conf.getPrivateRegistryImageSetting();
imageSetting.setServerUrl(ret.getServerUrl());
imageSetting.setUsername(ret.getUsername());
imageSetting.setPassword(ret.getPassword());
AzureTaskManager.getInstance().runLater(() -> openRunDialog(project, settings));
return;
}
AzureTaskManager.getInstance().runLater(() -> openRunDialog(project, ret));
}, err -> {
err.printStackTrace();
Notification notification = new Notification(NOTIFICATION_GROUP_ID, DIALOG_TITLE, err.getMessage(), NotificationType.ERROR);
Notifications.Bus.notify(notification);
});
}
Aggregations