use of org.jboss.tools.openshift.internal.core.docker.PushImageToRegistryJob in project jbosstools-openshift by jbosstools.
the class DeployImageWizard method getPushImageToRegistryJob.
private static PushImageToRegistryJob getPushImageToRegistryJob(final IDeployImageParameters model) {
final IDockerConnection dockerConnection = model.getDockerConnection();
final String imageName = model.getImageName();
final String deployProjectName = model.getProject().getName();
final IRegistryAccount registryAccount = new IRegistryAccount() {
@Override
public String getServerAddress() {
return model.getTargetRegistryLocation();
}
@Override
public String getUsername() {
return model.getTargetRegistryUsername();
}
@Override
public char[] getPassword() {
return model.getTargetRegistryPassword().toCharArray();
}
@Override
public String getEmail() {
return null;
}
@Override
public List<IRepositoryTag> getTags(String arg0) throws DockerException {
return null;
}
@Override
public boolean isVersion2() {
return false;
}
@Override
public List<IDockerImageSearchResult> getImages(String arg0) throws DockerException {
return null;
}
};
return new PushImageToRegistryJob(dockerConnection, registryAccount, deployProjectName, imageName);
}
use of org.jboss.tools.openshift.internal.core.docker.PushImageToRegistryJob 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();
}
Aggregations