Search in sources :

Example 1 with DefaultDeploymentPopupDriver

use of org.kie.workbench.common.screens.projecteditor.client.editor.DefaultDeploymentPopupDriver in project kie-wb-common by kiegroup.

the class ProductionBuildAndDeployExecutor method buildDeployWithMultipleServerTemplates.

@Override
void buildDeployWithMultipleServerTemplates(final BuildExecutionContext context, final List<ServerTemplate> serverTemplates) {
    context.setServerTemplate(serverTemplates.get(0));
    deploymentPopup.show(new DefaultDeploymentPopupDriver(context, DeploymentPopup.Mode.MULTIPLE_SERVER, () -> serverTemplates, () -> buildAndDeploy(context, DeploymentMode.VALIDATED), () -> finish()));
}
Also used : DefaultDeploymentPopupDriver(org.kie.workbench.common.screens.projecteditor.client.editor.DefaultDeploymentPopupDriver)

Example 2 with DefaultDeploymentPopupDriver

use of org.kie.workbench.common.screens.projecteditor.client.editor.DefaultDeploymentPopupDriver in project kie-wb-common by kiegroup.

the class ProductionBuildAndDeployExecutor method buildDeployWithOneServerTemplate.

@Override
void buildDeployWithOneServerTemplate(final BuildExecutionContext context, final ServerTemplate serverTemplate) {
    final Set<String> existingContainers = BuildUtils.extractExistingContainers(serverTemplate);
    context.setServerTemplate(serverTemplate);
    if (!existingContainers.contains(context.getContainerId())) {
        buildAndDeploy(context, DeploymentMode.VALIDATED);
    } else {
        deploymentPopup.show(new DefaultDeploymentPopupDriver(context, DeploymentPopup.Mode.SINGLE_SERVER, () -> Collections.EMPTY_LIST, () -> buildAndDeploy(context, DeploymentMode.VALIDATED), () -> finish()));
    }
}
Also used : DefaultDeploymentPopupDriver(org.kie.workbench.common.screens.projecteditor.client.editor.DefaultDeploymentPopupDriver)

Example 3 with DefaultDeploymentPopupDriver

use of org.kie.workbench.common.screens.projecteditor.client.editor.DefaultDeploymentPopupDriver in project kie-wb-common by kiegroup.

the class SnapshotBuildAndDeployExecutor method buildDeployWithMultipleServerTemplates.

@Override
void buildDeployWithMultipleServerTemplates(BuildExecutionContext context, List<ServerTemplate> serverTemplates) {
    GAV gav = context.getModule().getPom().getGav();
    Optional<SnapshotDeployment> optional = settings.getDeployment(gav.getGroupId(), gav.getArtifactId());
    if (optional.isPresent()) {
        SnapshotDeployment previousDeployment = optional.get();
        Optional<ServerTemplate> serverOptional = serverTemplates.stream().filter(s -> s.getId().equals(previousDeployment.getServer())).findFirst();
        if (serverOptional.isPresent()) {
            buildDeployWithOneServerTemplate(context, serverOptional.get());
            return;
        }
    }
    context.setServerTemplate(serverTemplates.get(0));
    deploymentPopup.show(new DefaultDeploymentPopupDriver(context, DeploymentPopup.Mode.MULTIPLE_SERVER_FORCED, () -> serverTemplates, () -> buildDeployWithOneServerTemplate(context, context.getServerTemplate()), () -> finish()));
}
Also used : Event(javax.enterprise.event.Event) SnapshotDeploymentSettings(org.kie.workbench.common.screens.projecteditor.build.exec.SnapshotDeploymentSettings) BuildResults(org.guvnor.common.services.project.builder.model.BuildResults) ErrorCallback(org.jboss.errai.common.client.api.ErrorCallback) ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) DefaultDeploymentPopupDriver(org.kie.workbench.common.screens.projecteditor.client.editor.DefaultDeploymentPopupDriver) GAV(org.guvnor.common.services.project.model.GAV) BuildDialog(org.kie.workbench.common.screens.projecteditor.client.build.exec.dialog.BuildDialog) KieServerMode(org.kie.server.api.model.KieServerMode) SnapshotDeployment(org.kie.workbench.common.screens.projecteditor.build.exec.SnapshotDeployment) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback) NotificationEvent(org.uberfire.workbench.events.NotificationEvent) BuildExecutionContext(org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext) DeploymentPopup(org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentPopup) List(java.util.List) DeploymentMode(org.guvnor.common.services.project.service.DeploymentMode) Message(org.jboss.errai.bus.client.api.messaging.Message) Caller(org.jboss.errai.common.client.api.Caller) SnapshotContextValidator(org.kie.workbench.common.screens.projecteditor.client.build.exec.impl.executors.validators.SnapshotContextValidator) Optional(java.util.Optional) SpecManagementService(org.kie.workbench.common.screens.server.management.service.SpecManagementService) BuildService(org.guvnor.common.services.project.builder.service.BuildService) SnapshotDeployment(org.kie.workbench.common.screens.projecteditor.build.exec.SnapshotDeployment) ServerTemplate(org.kie.server.controller.api.model.spec.ServerTemplate) DefaultDeploymentPopupDriver(org.kie.workbench.common.screens.projecteditor.client.editor.DefaultDeploymentPopupDriver) GAV(org.guvnor.common.services.project.model.GAV)

Aggregations

DefaultDeploymentPopupDriver (org.kie.workbench.common.screens.projecteditor.client.editor.DefaultDeploymentPopupDriver)3 List (java.util.List)1 Optional (java.util.Optional)1 Event (javax.enterprise.event.Event)1 BuildResults (org.guvnor.common.services.project.builder.model.BuildResults)1 BuildService (org.guvnor.common.services.project.builder.service.BuildService)1 GAV (org.guvnor.common.services.project.model.GAV)1 DeploymentMode (org.guvnor.common.services.project.service.DeploymentMode)1 Message (org.jboss.errai.bus.client.api.messaging.Message)1 Caller (org.jboss.errai.common.client.api.Caller)1 ErrorCallback (org.jboss.errai.common.client.api.ErrorCallback)1 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)1 KieServerMode (org.kie.server.api.model.KieServerMode)1 ServerTemplate (org.kie.server.controller.api.model.spec.ServerTemplate)1 SnapshotDeployment (org.kie.workbench.common.screens.projecteditor.build.exec.SnapshotDeployment)1 SnapshotDeploymentSettings (org.kie.workbench.common.screens.projecteditor.build.exec.SnapshotDeploymentSettings)1 BuildExecutionContext (org.kie.workbench.common.screens.projecteditor.client.build.exec.BuildExecutionContext)1 BuildDialog (org.kie.workbench.common.screens.projecteditor.client.build.exec.dialog.BuildDialog)1 SnapshotContextValidator (org.kie.workbench.common.screens.projecteditor.client.build.exec.impl.executors.validators.SnapshotContextValidator)1 DeploymentPopup (org.kie.workbench.common.screens.projecteditor.client.editor.DeploymentPopup)1