use of org.jboss.tools.openshift.internal.ui.job.DeployImageJob in project jbosstools-openshift by jbosstools.
the class DeployImageWizard method getJobChain.
/**
* Gets the Job to run as a chain of smaller jobs, depending on the use-case
* @param model the wizard model
* @param shell the current shell
* @return
*/
private Job getJobChain(final IDeployImageParameters model, final Shell shell) {
final DeployImageJob deployJob = getDeployImageJob(getModel(), getShell());
final boolean pushImageToRegistry = model.isPushImageToRegistry();
if (pushImageToRegistry) {
final PushImageToRegistryJob pushImageToRegistryJob = getPushImageToRegistryJob(model);
return new JobChainBuilder(pushImageToRegistryJob).runWhenSuccessfullyDone(deployJob).runWhenSuccessfullyDone(new RefreshResourcesJob(deployJob, true)).build();
}
return new JobChainBuilder(deployJob).runWhenSuccessfullyDone(new RefreshResourcesJob(deployJob, true)).build();
}
use of org.jboss.tools.openshift.internal.ui.job.DeployImageJob in project jbosstools-openshift by jbosstools.
the class DeployImageWizard method getDeployImageJob.
private static DeployImageJob getDeployImageJob(final IDeployImageParameters model, final Shell shell) {
final DeployImageJob deployJob = new DeployImageJob(model);
deployJob.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
IStatus status = event.getResult();
if ((JobUtils.isOk(status) || JobUtils.isWarning(status)) && !deployJob.getResources().isEmpty()) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
new ResourceSummaryDialog(shell, deployJob.getResources(), TITLE, deployJob.getSummaryMessage()).open();
}
});
OpenShiftUIUtils.showOpenShiftExplorer();
}
}
});
return deployJob;
}
Aggregations