Compare commits

...

7 Commits

Author SHA1 Message Date
SunChaoqun
c2c159e063 TESB-24597:Docker Support for Microservice - CI Part 2019-07-24 16:16:51 +08:00
SunChaoqun
fd4fbf52dd TESB-24597:Docker Support for Microservice - CI Part 2019-07-23 17:43:52 +08:00
SunChaoqun
27afea0005 TESB-24597:Docker Support for Microservice - CI Part 2019-07-22 19:15:08 +08:00
SunChaoqun
fc6f6f54d4 TESB-24597:Docker Support for Microservice - CI Part 2019-07-19 16:17:47 +08:00
SunChaoqun
c7bb760929 TESB-24597:Docker Support for Microservice - CI Part 2019-07-19 16:02:44 +08:00
SunChaoqun
eb627b8956 TESB-24597:Docker Support for Microservice - CI Part 2019-07-19 16:02:27 +08:00
SunChaoqun
d8ea9b1fa8 TESB-24597:Docker Support for Microservice - CI Part 2019-07-18 14:43:08 +08:00
5 changed files with 100 additions and 11 deletions

View File

@@ -12,11 +12,14 @@
// ============================================================================
package org.talend.core;
import java.util.List;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPart;
import org.talend.core.model.process.INode;
import org.talend.core.model.process.IProcess;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.Property;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.utils.IXSDPopulationUtil;
@@ -47,6 +50,8 @@ public interface IESBService extends IService {
public StringBuffer getAllTheJObNames(IRepositoryNode jobList);
public List<String> getSerivceRelatedJobIds(Item serviceItem);
public void deleteOldRelation(String jobID);
// public void setSelectedItem(Item, )
@@ -59,6 +64,8 @@ public interface IESBService extends IService {
public void copyDataServiceRelateJob(Item newItem);
public boolean isRESTService(ProcessItem processItem);
public IXSDPopulationUtil getXSDPopulationUtil();
public boolean isWSDLEditor(IWorkbenchPart part);

View File

@@ -2628,5 +2628,4 @@ public class ProcessorUtilities {
public static boolean isNeedProjectProcessId(String componentName) {
return "tRunJob".equalsIgnoreCase(componentName) || "cTalendJob".equalsIgnoreCase(componentName);
}
}

View File

@@ -33,7 +33,10 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.model.Activation;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Model;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginExecution;
import org.apache.maven.model.Profile;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.CoreException;
@@ -898,4 +901,40 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
}
}
protected Plugin addSkipDockerMavenPlugin() {
Plugin plugin = new Plugin();
plugin.setGroupId("io.fabric8");
plugin.setArtifactId("fabric8-maven-plugin");
plugin.setVersion("4.0.0");
Xpp3Dom skip = new Xpp3Dom("skip");
// skip.setValue("${docker.skip}");
skip.setValue("true");
Xpp3Dom configuration = new Xpp3Dom("configuration");
configuration.addChild(skip);
List<PluginExecution> pluginExecutions = new ArrayList<PluginExecution>();
PluginExecution pluginExecutionStart = new PluginExecution();
pluginExecutionStart.setId("start");
pluginExecutionStart.setPhase("none");
pluginExecutionStart.setConfiguration(configuration);
pluginExecutions.add(pluginExecutionStart);
PluginExecution pluginExecutionPushImage = new PluginExecution();
pluginExecutionPushImage.setId("push-image");
pluginExecutionPushImage.setPhase("none");
pluginExecutionPushImage.setConfiguration(configuration);
pluginExecutions.add(pluginExecutionPushImage);
plugin.setExecutions(pluginExecutions);
plugin.setConfiguration(configuration);
return plugin;
}
}

View File

@@ -33,11 +33,16 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.IProgressMonitor;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IESBService;
import org.talend.core.PluginChecker;
import org.talend.core.model.process.JobInfo;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.Property;
import org.talend.core.model.relationship.Relation;
import org.talend.core.model.relationship.RelationshipItemBuilder;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.runtime.maven.MavenConstants;
import org.talend.core.runtime.process.ITalendProcessJavaProject;
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
@@ -50,6 +55,7 @@ import org.talend.designer.maven.tools.AggregatorPomsHelper;
import org.talend.designer.maven.utils.PomIdsHelper;
import org.talend.designer.maven.utils.PomUtil;
import org.talend.designer.runprocess.IProcessor;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.utils.io.FilesUtils;
import org.w3c.dom.Document;
@@ -108,8 +114,9 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
@Override
protected Model createModel() {
Model model = super.createModel();
boolean isServiceOperation = isServiceOperation(getJobProcessor().getProperty());
List<Profile> profiles = model.getProfiles();
for (Profile profile : profiles) {
@@ -141,12 +148,22 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
}
model.setName(model.getName() + " Bundle");
model.addProperty("talend.job.finalName", "${talend.job.name}-bundle-${project.version}");
Build build = model.getBuild();
IESBService service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
if (isServiceOperation || service.isRESTService((ProcessItem) getJobProcessor().getProperty().getItem())) {
build.addPlugin(addSkipDockerMavenPlugin());
}
if (isServiceOperation) {
model.addProperty("cloud.publisher.skip", "true");
Build build = model.getBuild();
build = model.getBuild();
List<Plugin> removePlugins = new ArrayList<Plugin>();
if (build != null) {
List<Plugin> plugins = build.getPlugins();
for (Plugin p : plugins) {
if (p.getArtifactId().equals("maven-deploy-plugin")) {
@@ -260,14 +277,30 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
* @return
*/
public boolean isServiceOperation(Property property) {
List<Relation> relations = RelationshipItemBuilder.getInstance().getItemsRelatedTo(property.getId(),
property.getVersion(), RelationshipItemBuilder.JOB_RELATION);
List<IRepositoryViewObject> serviceRepoList = null;
for (Relation relation : relations) {
if (RelationshipItemBuilder.SERVICES_RELATION.equals(relation.getType())) {
return true;
boolean isDataServiceOperation = false;
IESBService service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
try {
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
serviceRepoList = factory.getAll(ERepositoryObjectType.valueOf(ERepositoryObjectType.class, "SERVICES"));
for (IRepositoryViewObject serviceItem : serviceRepoList) {
if (service != null) {
List<String> jobIds = service.getSerivceRelatedJobIds(serviceItem.getProperty().getItem());
if (jobIds.contains(property.getId())) {
isDataServiceOperation = true;
break;
}
}
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
return false;
return isDataServiceOperation;
}
}

View File

@@ -454,7 +454,18 @@ public class ImportExportHandlersManager {
return 0;
}
});
Collections.sort(checkedItemRecords, new Comparator<ImportItem>() {
@Override
public int compare(ImportItem o1, ImportItem o2) {
if (o1.getRepositoryType().getType().equals("SERVICES")) {
return -1;
} else if (o2.getRepositoryType().getType().equals("SERVICES")) {
return 1;
}
return 0;
}
});
ImportCacheHelper importCacheHelper = ImportCacheHelper.getInstance();
try {
// cache