+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java">
- <attributes>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java">
- <attributes>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
import com.akraino.bpm.model.Deploy;
import com.akraino.bpm.model.Onap;
import com.akraino.bpm.model.Tempest;
+import com.akraino.bpm.model.MultiNodeDeploy;
import com.akraino.bpm.service.AsyncProcessExecutorService;
import io.swagger.annotations.Api;
@PostMapping("/build/")
public ResponseEntity<BuildResponse> build(@RequestBody Build build) {
- logger.debug("Request received for Build ",build.toString());
+ logger.debug("Request received for Build {}",build.toString());
asyncProcessExecutorService.executeBuildProcess(build);
return new ResponseEntity<BuildResponse>(new BuildResponse("in progress",null,null,null,null,build.getSitename(),null,null,null),HttpStatus.OK);
@PostMapping("/deploy/")
public ResponseEntity<BuildResponse> deploy(@RequestBody Deploy deploy) {
- logger.debug("Request received for executing {} and targetDirectory {} ",deploy.toString());
+ logger.debug("Request received for deploy {} ",deploy.toString());
asyncProcessExecutorService.executeDeployProcess(deploy);
return new ResponseEntity<BuildResponse>(new BuildResponse(null,"in progress","not started","not started","not started",deploy.getSitename(),null,null,null),HttpStatus.OK);
}
+ @PostMapping("/multinodedeploy/")
+ public ResponseEntity<BuildResponse> multiNodeDeploy(@RequestBody MultiNodeDeploy multiNodeDeploy) {
+ logger.debug("Request received for multi node deploy {} ",multiNodeDeploy.toString());
+ asyncProcessExecutorService.executeMultiNodeDeployProcess(multiNodeDeploy);
+ return new ResponseEntity<BuildResponse>(new BuildResponse(null,"in progress","not started","not started","not started",multiNodeDeploy.getSitename(),null,null,null),HttpStatus.OK);
+ }
@PostMapping("/airship/")
@PostMapping("/tempest/")
public ResponseEntity<BuildResponse> tempest(@RequestBody Tempest tempest) {
- logger.debug("Request received for onap ",tempest.toString());
+ logger.debug("Request received for tempest {}",tempest.toString());
asyncProcessExecutorService.executeTempestProcess(tempest);
return new ResponseEntity<BuildResponse>(new BuildResponse(null,null,null,null,null,tempest.getSitename(),null,null,"in progress"),HttpStatus.OK);
}
@PostMapping("/apache/")
public ResponseEntity<BuildResponse> apache(@RequestBody Apache apache) {
- logger.debug("Request received for onap ",apache.toString());
+ logger.debug("Request received for apache{} ",apache.toString());
asyncProcessExecutorService.executeApacheProcess(apache);
return new ResponseEntity<BuildResponse>(new BuildResponse(null,null,null,null,null,apache.getSitename(),null,"in progress",null),HttpStatus.OK);
}
--- /dev/null
+/*
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.akraino.bpm.delegate;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.akraino.bpm.service.DeployResponseSenderService;
+import com.akraino.bpm.service.RemoteScriptExecutionService;
+
+
+
+@Component
+public class MultiNodeDeployRemoteScript1ExecutorTaskDelegate implements JavaDelegate {
+
+
+ private static Logger logger = LoggerFactory.getLogger(MultiNodeDeployRemoteScript1ExecutorTaskDelegate.class);
+
+ @Autowired
+ RemoteScriptExecutionService remoteScriptExecutionService;
+
+ @Autowired
+ DeployResponseSenderService deployResponseSenderService;
+
+
+ public void execute(DelegateExecution ctx) throws Exception {
+
+
+ String remotserver=(String)ctx.getVariable("remotserver");
+ int portnumner=(Integer)ctx.getVariable("port");
+ String username=(String)ctx.getVariable("username");
+ String password=(String)ctx.getVariable("password");
+ String filename=(String)ctx.getVariable("remotefile1");
+ String fileparams=(String)ctx.getVariable("remotefile1params");
+ String destdir=(String)ctx.getVariable("destdir1");
+
+ logger.debug("task execution started remotserver {} , portnumner {},username {}, password {},filename : {} ,fileparams={},dest dir={}",
+ remotserver,portnumner,username,password,filename,fileparams,destdir);
+ String command="cd "+destdir+ ";" +" bash "+filename+" "+ (fileparams!=null?fileparams:" ") ;
+ logger.debug("Execution command {}",command);
+ remoteScriptExecutionService.executeRemoteScript(remotserver,username,password,portnumner,filename,fileparams,null,destdir,command);
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.akraino.bpm.delegate;
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.akraino.bpm.model.BuildResponse;
+import com.akraino.bpm.service.DeployResponseSenderService;
+import com.akraino.bpm.service.RemoteScriptExecutionService;
+
+
+
+@Component
+public class MultiNodeDeployRemoteScript2ExecutorTaskDelegate implements JavaDelegate {
+
+
+ private static Logger logger = LoggerFactory.getLogger(MultiNodeDeployRemoteScript2ExecutorTaskDelegate.class);
+
+ @Autowired
+ RemoteScriptExecutionService remoteScriptExecutionService;
+
+ @Autowired
+ DeployResponseSenderService deployResponseSenderService;
+
+
+ public void execute(DelegateExecution ctx) throws Exception {
+ String remotserver=(String)ctx.getVariable("remotserver");
+ int portnumner=(Integer)ctx.getVariable("port");
+ String username=(String)ctx.getVariable("username");
+ String password=(String)ctx.getVariable("password");
+ String filename=(String)ctx.getVariable("remotefile2");
+ String fileparams=(String)ctx.getVariable("remotefile2params");
+ String destdir=(String)ctx.getVariable("destdir2");
+ String sitename=(String)ctx.getVariable("sitename");
+
+ deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "completed", "inprogress","not started",sitename,null,null,null));
+
+ logger.debug("task execution started remotserver {} , portnumner {},username {}, password {},filename : {} ,fileparams={},dest dir={}",
+ remotserver,portnumner,username,password,filename,fileparams,destdir);
+
+ String command="cd "+destdir+ ";" +" bash "+filename+" "+ (fileparams!=null?fileparams:" ") ;
+ logger.debug("Execution command {}",command);
+ remoteScriptExecutionService.executeRemoteScript(remotserver,username,password,portnumner,filename,fileparams,null,destdir,command);
+
+ deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "completed", "completed","completed",sitename,null,null,null));
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.akraino.bpm.delegate;
+
+import org.camunda.bpm.engine.RuntimeService;
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+
+import com.akraino.bpm.service.ScriptExecutionService;
+
+
+@Component
+public class MultiNodeScript1ExecutorTaskDelegate implements JavaDelegate {
+
+ @Autowired
+ RuntimeService runtimeService;
+
+ private static Logger logger = LoggerFactory.getLogger(MultiNodeScript1ExecutorTaskDelegate.class);
+
+ @Autowired
+ ScriptExecutionService scriptExecutionService;
+
+ public void execute(DelegateExecution ctx) throws Exception {
+ String filename=(String)ctx.getVariable("file1");
+ String fileparams=(String)ctx.getVariable("file1params");
+
+ int lastindex=filename.lastIndexOf("/");
+ String srcdir=filename.substring(0,lastindex);
+ String task=filename.substring(lastindex+1,filename.length());
+
+ String file= task+" "+(fileparams!=null?fileparams.replaceAll(",", " "):" ");
+
+
+ logger.debug("task execution started filename:{}, directory:{}",file,srcdir);
+ scriptExecutionService.executeCDBashScript(srcdir, file);
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.akraino.bpm.delegate;
+
+
+import org.camunda.bpm.engine.delegate.DelegateExecution;
+import org.camunda.bpm.engine.delegate.JavaDelegate;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.akraino.bpm.model.BuildResponse;
+import com.akraino.bpm.service.DeployResponseSenderService;
+import com.akraino.bpm.service.ScriptExecutionService;
+
+
+@Component
+public class MultiNodeWinScpScriptDelegate implements JavaDelegate {
+
+ private static Logger logger = LoggerFactory.getLogger(MultiNodeWinScpScriptDelegate.class);
+
+ @Autowired
+ DeployResponseSenderService deployResponseSenderService;
+
+ @Autowired
+ ScriptExecutionService scriptExecutionService;
+
+ public void execute(DelegateExecution ctx) throws Exception {
+
+ String sitename=(String)ctx.getVariable("sitename");
+ deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "inprogress", "not started","not started",sitename,null,null,null));
+ String filename=(String)ctx.getVariable("scpfilename");
+ String dir=(String)ctx.getVariable("winscpdir");
+ logger.debug("Win SCP task execution started filename:{},directory:{}",filename,dir);
+
+ scriptExecutionService.executeCDBashScript(dir, filename);
+
+
+ }
+
+}
private String vCDNStatus;
private String tempestStatus;
+
public BuildResponse(String buildStatus, String createTarStatus, String genesisNodeStatus, String deployToolsStatus,String deployStatus,
String siteName,String onapStatus,String vCDNStatus,String tempestStatus) {
super();
this.vCDNStatus=vCDNStatus;
this.tempestStatus=tempestStatus;
}
-
-
+
public String getBuildStatus() {
return buildStatus;
}
this.tempestStatus = tempestStatus;
}
-
@Override
public String toString() {
return "BuildResponse [siteName=" + siteName + ", buildStatus=" + buildStatus + ", createTarStatus="
+ vCDNStatus + ", tempestStatus=" + tempestStatus + "]";
}
+
+
}
--- /dev/null
+/*
+ * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.akraino.bpm.model;
+
+public class MultiNodeDeploy {
+
+ private String sitename;
+ private String file1;
+ private String file1params;
+ private String winscpfilepath;
+ private String winscpfileparams;
+ private String remotserver;
+ private int port;
+ private String username;
+ private String password;
+ private String destdir1;
+ private String remotefile1;
+ private String remotefile1params;
+ private String destdir2;
+ private String remotefile2;
+ private String remotefile2params;
+ public String getSitename() {
+ return sitename;
+ }
+ public void setSitename(String sitename) {
+ this.sitename = sitename;
+ }
+ public String getFile1() {
+ return file1;
+ }
+ public void setFile1(String file1) {
+ this.file1 = file1;
+ }
+ public String getFile1params() {
+ return file1params;
+ }
+ public void setFile1params(String file1params) {
+ this.file1params = file1params;
+ }
+ public String getWinscpfilepath() {
+ return winscpfilepath;
+ }
+ public void setWinscpfilepath(String winscpfilepath) {
+ this.winscpfilepath = winscpfilepath;
+ }
+ public String getWinscpfileparams() {
+ return winscpfileparams;
+ }
+ public void setWinscpfileparams(String winscpfileparams) {
+ this.winscpfileparams = winscpfileparams;
+ }
+ public String getRemotserver() {
+ return remotserver;
+ }
+ public void setRemotserver(String remotserver) {
+ this.remotserver = remotserver;
+ }
+ public int getPort() {
+ return port;
+ }
+ public void setPort(int port) {
+ this.port = port;
+ }
+ public String getUsername() {
+ return username;
+ }
+ public void setUsername(String username) {
+ this.username = username;
+ }
+ public String getPassword() {
+ return password;
+ }
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getRemotefile1() {
+ return remotefile1;
+ }
+ public void setRemotefile1(String remotefile1) {
+ this.remotefile1 = remotefile1;
+ }
+ public String getRemotefile1params() {
+ return remotefile1params;
+ }
+ public void setRemotefile1params(String remotefile1params) {
+ this.remotefile1params = remotefile1params;
+ }
+ public String getRemotefile2() {
+ return remotefile2;
+ }
+ public void setRemotefile2(String remotefile2) {
+ this.remotefile2 = remotefile2;
+ }
+ public String getRemotefile2params() {
+ return remotefile2params;
+ }
+ public void setRemotefile2params(String remotefile2params) {
+ this.remotefile2params = remotefile2params;
+ }
+ public String getDestdir1() {
+ return destdir1;
+ }
+ public void setDestdir1(String destdir1) {
+ this.destdir1 = destdir1;
+ }
+ public String getDestdir2() {
+ return destdir2;
+ }
+ public void setDestdir2(String destdir2) {
+ this.destdir2 = destdir2;
+ }
+
+
+ @Override
+ public String toString() {
+ return "MultiNodeDeploy [sitename=" + sitename + ", file1=" + file1 + ", file1params=" + file1params
+ + ", winscpfilepath=" + winscpfilepath + ", winscpfileparams=" + winscpfileparams + ", remotserver="
+ + remotserver + ", port=" + port + ", username=" + username + ", password=" + password + ", destdir1="
+ + destdir1 + ", remotefile1=" + remotefile1 + ", remotefile1params=" + remotefile1params + ", destdir2="
+ + destdir2 + ", remotefile2=" + remotefile2 + ", remotefile2params=" + remotefile2params + "]";
+ }
+
+
+
+ }
import com.akraino.bpm.model.Apache;
import com.akraino.bpm.model.Build;
import com.akraino.bpm.model.Deploy;
+import com.akraino.bpm.model.MultiNodeDeploy;
import com.akraino.bpm.model.Onap;
import com.akraino.bpm.model.Tempest;
public void executeTempestProcess(Tempest tempest);
public void executeApacheProcess(Apache apache);
+
+ public void executeMultiNodeDeployProcess(MultiNodeDeploy multiNodeDeploy);
}
public void executeCDScript(String dir,String cmd);
+ public void executeCDBashScript(String dir,String cmd);
-
- //public void executeAirshipScript(String cmd);
-
-
}
import com.akraino.bpm.model.Build;
import com.akraino.bpm.model.BuildResponse;
import com.akraino.bpm.model.Deploy;
+import com.akraino.bpm.model.MultiNodeDeploy;
import com.akraino.bpm.model.Onap;
import com.akraino.bpm.model.Tempest;
import com.akraino.bpm.service.AsyncProcessExecutorService;
deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,"exception: "+ex.getMessage(),airship.getSitename(),null,null,null));
return;
}
- logger.debug("Airship execution sucess ");
+ logger.debug("Airship execution success ");
deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,"success",airship.getSitename(),null,null,null));
deployResponseSenderService.sendResponse(new BuildResponse("exception: "+ex.getMessage(),null,null,null,null,build.getSitename(),null,null,null));
return;
}
- logger.debug("Build execution sucess ");
+ logger.debug("Build execution success ");
deployResponseSenderService.sendResponse(new BuildResponse("success",null,null,null,null,build.getSitename(),null,null,null));
}
deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,"exception: "+ex.getMessage(),deploy.getSitename(),null,null,null));
return;
}
- logger.debug("deploy execution sucess ");
+ logger.debug("deploy execution success ");
deployResponseSenderService.sendResponse(new BuildResponse("success","success","success","success","success",deploy.getSitename(),null,null,null));
}
deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,onap.getSitename(),"exception: "+ex.getMessage(),null,null));
return;
}
- logger.debug("Onap execution sucess ");
+ logger.debug("Onap execution success ");
deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,onap.getSitename(),"succes",null,null));
deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,tempest.getSitename(),null,null,"exception: "+ex.getMessage()));
return;
}
- logger.debug("Tempest execution sucess ");
+ logger.debug("Tempest execution success ");
deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,tempest.getSitename(),null,null,"success"));
}
deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,apache.getSitename(),null,"exception: "+ex.getMessage(),null));
return;
}
- logger.debug("Apache execution sucess ");
+ logger.debug("Apache execution success ");
deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,apache.getSitename(),null,"success",null));
}
-
private ProcessInstance executeApacheService(Apache apache) {
int lastindex=apache.getFiletrasferscript().lastIndexOf("/");
}
-
- }
+ @Async
+ public void executeMultiNodeDeployProcess(MultiNodeDeploy multiNodeDeploy) {
+ try {
+ executeMultiNodeDeployService(multiNodeDeploy);
+ }catch(TaskExecutorException ex) {
+ logger.error("MultiNodeDeploy execution failed ",ex);
+ deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,"exception: "+ex.getMessage(),multiNodeDeploy.getSitename(),null,null,null));
+ return;
+ }
+ logger.debug("MultiNodeDeploy execution success ");
+ deployResponseSenderService.sendResponse(new BuildResponse("success","success","success","success","success",multiNodeDeploy.getSitename(),null,null,null));
+
+ }
+
+ private ProcessInstance executeMultiNodeDeployService(MultiNodeDeploy multiNodeDeploy) {
+
+ int lastindex=multiNodeDeploy.getWinscpfilepath().lastIndexOf("/");
+ String scpSrcDir=multiNodeDeploy.getWinscpfilepath().substring(0,lastindex);
+ String scpfilename=multiNodeDeploy.getWinscpfilepath().substring(lastindex+1,multiNodeDeploy.getWinscpfilepath().length());
+
+ String transferfile= scpfilename+" "+(multiNodeDeploy.getWinscpfileparams()!=null?multiNodeDeploy.getWinscpfileparams().replaceAll(",", " "):" ");
+
+ return camunda.getRuntimeService().startProcessInstanceByKey("multinodedeploy",
+ Variables.putValue("file1", multiNodeDeploy.getFile1()).putValue("file1params", multiNodeDeploy.getFile1params())
+ .putValue("winscpdir", scpSrcDir)
+ .putValue("scpfilename", transferfile)
+ .putValue("remotserver", multiNodeDeploy.getRemotserver())
+ .putValue("username", multiNodeDeploy.getUsername())
+ .putValue("password", multiNodeDeploy.getPassword())
+ .putValue("port", multiNodeDeploy.getPort())
+ .putValue("destdir1",multiNodeDeploy.getDestdir1()).putValue("destdir2", multiNodeDeploy.getDestdir2())
+ .putValue("remotefile1", multiNodeDeploy.getRemotefile1()).putValue("remotefile1params", multiNodeDeploy.getRemotefile1params())
+ .putValue("sitename", multiNodeDeploy.getSitename()).putValue("remotefile2", multiNodeDeploy.getRemotefile2()).putValue("remotefile2params", multiNodeDeploy.getRemotefile2params())
+ );
+
+ }
+
+}
p.waitFor();
logger.debug("Script exit code :"+p.exitValue());
if(p.exitValue()!=0) {
- throw new TaskExecutorException("problem while executing the script . exist code :"+p.exitValue());
+ throw new TaskExecutorException("problem while executing the script . exit code :"+p.exitValue());
}
}
+ public void executeCDBashScript(String dir,String cmd) {
+
+ try {
+ logger.debug("Executing the script.............dir:{},command:{}",dir,cmd);
+
+ String[] command = { "/bin/bash", "-c", "bash "+cmd };
+ Process p = Runtime.getRuntime().exec(command, null, new File(dir));
+ p.waitFor();
+ BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String line = "";
+ while ((line = input.readLine()) != null) {
+ logger.debug(line);
+ }
+ logger.debug("Script exit code :"+p.exitValue());
+ if(p.exitValue()!=0) {
+ throw new TaskExecutorException("problem while executing the script . exist code :"+p.exitValue());
+ }
+
+
+ } catch (IOException e) {
+ throw new TaskExecutorException(cmd + " not found.");
+ } catch (InterruptedException e) {
+ throw new TaskExecutorException("problem while executing the script "+cmd);
+ }
+
+ }
+
+
+
+
/*public void executeAirshipScript(String cmd) {
try {
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0ryxuei" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.16.0">
+ <bpmn:process id="multinodedeploy" name="multinodedeploy" isExecutable="true" camunda:versionTag="1">
+ <bpmn:sequenceFlow id="SequenceFlow_125l5l0" sourceRef="StartEvent_1" targetRef="Task_19usii1" />
+ <bpmn:startEvent id="StartEvent_1" name="ScriptExecutionStartingPoint">
+ <bpmn:outgoing>SequenceFlow_125l5l0</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:serviceTask id="Task_19usii1" name="ScriptExecutorTask" camunda:delegateExpression="#{multiNodeScript1ExecutorTaskDelegate}">
+ <bpmn:incoming>SequenceFlow_125l5l0</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_05ubysv</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:serviceTask id="Task_1jo0y1o" name="WinSCPScriptExecutortask" camunda:delegateExpression="#{multiNodeWinScpScriptDelegate}">
+ <bpmn:incoming>SequenceFlow_05ubysv</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1jh4nm3</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1jh4nm3" sourceRef="Task_1jo0y1o" targetRef="DeployRemoteexecutor" />
+ <bpmn:serviceTask id="DeployRemoteexecutor" name="Deploy Remote Script 1 excutor" camunda:delegateExpression="#{multiNodeDeployRemoteScript1ExecutorTaskDelegate}">
+ <bpmn:incoming>SequenceFlow_1jh4nm3</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1b4e6j2</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_05ubysv" sourceRef="Task_19usii1" targetRef="Task_1jo0y1o" />
+ <bpmn:serviceTask id="ServiceTask_1fcq5wy" name="Deploy Remote Script 2 excutor" camunda:delegateExpression="#{multiNodeDeployRemoteScript2ExecutorTaskDelegate}">
+ <bpmn:incoming>SequenceFlow_1b4e6j2</bpmn:incoming>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1b4e6j2" sourceRef="DeployRemoteexecutor" targetRef="ServiceTask_1fcq5wy" />
+ <bpmn:textAnnotation id="TextAnnotation_1p71e63">
+ <bpmn:text>Rest</bpmn:text>
+ </bpmn:textAnnotation>
+ <bpmn:association id="Association_0bjstyh" sourceRef="StartEvent_1" targetRef="TextAnnotation_1p71e63" />
+ <bpmn:textAnnotation id="TextAnnotation_00kckqx">
+ <bpmn:text>Script 1 execution Task</bpmn:text>
+ </bpmn:textAnnotation>
+ <bpmn:association id="Association_16sojmg" sourceRef="Task_19usii1" targetRef="TextAnnotation_00kckqx" />
+ <bpmn:textAnnotation id="TextAnnotation_08xc1st">
+ <bpmn:text>Win Scp Script Executor</bpmn:text>
+ </bpmn:textAnnotation>
+ <bpmn:association id="Association_05u86o6" sourceRef="Task_1jo0y1o" targetRef="TextAnnotation_08xc1st" />
+ <bpmn:textAnnotation id="TextAnnotation_071um3l">
+ <bpmn:text>Remote Script 1 Executor</bpmn:text>
+ </bpmn:textAnnotation>
+ <bpmn:association id="Association_0xluc8y" sourceRef="DeployRemoteexecutor" targetRef="TextAnnotation_071um3l" />
+ <bpmn:textAnnotation id="TextAnnotation_1xt9xdh">
+ <bpmn:text>Remote Script 2 executor</bpmn:text>
+ </bpmn:textAnnotation>
+ <bpmn:association id="Association_1yfo16k" sourceRef="ServiceTask_1fcq5wy" targetRef="TextAnnotation_1xt9xdh" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="multinodedeploy">
+ <bpmndi:BPMNEdge id="SequenceFlow_125l5l0_di" bpmnElement="SequenceFlow_125l5l0">
+ <di:waypoint x="330" y="278" />
+ <di:waypoint x="368" y="278" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="387" y="265" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="TextAnnotation_1p71e63_di" bpmnElement="TextAnnotation_1p71e63">
+ <dc:Bounds x="339" y="182" width="100" height="30" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="Association_0bjstyh_di" bpmnElement="Association_0bjstyh">
+ <di:waypoint x="324" y="265" />
+ <di:waypoint x="375" y="212" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="TextAnnotation_00kckqx_di" bpmnElement="TextAnnotation_00kckqx">
+ <dc:Bounds x="469" y="153" width="100" height="39" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="Association_16sojmg_di" bpmnElement="Association_16sojmg">
+ <di:waypoint x="456" y="238" />
+ <di:waypoint x="501" y="192" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
+ <dc:Bounds x="294" y="260" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="270" y="296" width="88" height="27" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_0y4nqij_di" bpmnElement="Task_19usii1">
+ <dc:Bounds x="368" y="238" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="TextAnnotation_08xc1st_di" bpmnElement="TextAnnotation_08xc1st">
+ <dc:Bounds x="805" y="153" width="100" height="42" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="Association_05u86o6_di" bpmnElement="Association_05u86o6">
+ <di:waypoint x="687" y="254" />
+ <di:waypoint x="811" y="195" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_0ek6xsx_di" bpmnElement="Task_1jo0y1o">
+ <dc:Bounds x="587" y="238" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1jh4nm3_di" bpmnElement="SequenceFlow_1jh4nm3">
+ <di:waypoint x="687" y="278" />
+ <di:waypoint x="797" y="278" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="704" y="265" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_0gdjdwl_di" bpmnElement="DeployRemoteexecutor">
+ <dc:Bounds x="797" y="238" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="TextAnnotation_071um3l_di" bpmnElement="TextAnnotation_071um3l">
+ <dc:Bounds x="986" y="159" width="100" height="39" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="Association_0xluc8y_di" bpmnElement="Association_0xluc8y">
+ <di:waypoint x="897" y="252" />
+ <di:waypoint x="1000" y="198" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_05ubysv_di" bpmnElement="SequenceFlow_05ubysv">
+ <di:waypoint x="468" y="278" />
+ <di:waypoint x="587" y="278" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_1fcq5wy_di" bpmnElement="ServiceTask_1fcq5wy">
+ <dc:Bounds x="1018" y="228" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1b4e6j2_di" bpmnElement="SequenceFlow_1b4e6j2">
+ <di:waypoint x="897" y="278" />
+ <di:waypoint x="958" y="278" />
+ <di:waypoint x="958" y="268" />
+ <di:waypoint x="1018" y="268" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="TextAnnotation_1xt9xdh_di" bpmnElement="TextAnnotation_1xt9xdh">
+ <dc:Bounds x="1118" y="148" width="100" height="41" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="Association_1yfo16k_di" bpmnElement="Association_1yfo16k">
+ <di:waypoint x="1108" y="228" />
+ <di:waypoint x="1148" y="189" />
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_0ryxuei" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.16.0">
+ <bpmn:process id="multinodedeploy" name="multinodedeploy" isExecutable="true" camunda:versionTag="1">
+ <bpmn:sequenceFlow id="SequenceFlow_125l5l0" sourceRef="StartEvent_1" targetRef="Task_19usii1" />
+ <bpmn:startEvent id="StartEvent_1" name="ScriptExecutionStartingPoint">
+ <bpmn:outgoing>SequenceFlow_125l5l0</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:serviceTask id="Task_19usii1" name="ScriptExecutorTask" camunda:delegateExpression="#{multiNodeScript1ExecutorTaskDelegate}">
+ <bpmn:incoming>SequenceFlow_125l5l0</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_05ubysv</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:serviceTask id="Task_1jo0y1o" name="WinSCPScriptExecutortask" camunda:delegateExpression="#{multiNodeWinScpScriptDelegate}">
+ <bpmn:incoming>SequenceFlow_05ubysv</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1jh4nm3</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1jh4nm3" sourceRef="Task_1jo0y1o" targetRef="DeployRemoteexecutor" />
+ <bpmn:serviceTask id="DeployRemoteexecutor" name="Deploy Remote Script 1 excutor" camunda:delegateExpression="#{multiNodeDeployRemoteScript1ExecutorTaskDelegate}">
+ <bpmn:incoming>SequenceFlow_1jh4nm3</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1b4e6j2</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_05ubysv" sourceRef="Task_19usii1" targetRef="Task_1jo0y1o" />
+ <bpmn:serviceTask id="ServiceTask_1fcq5wy" name="Deploy Remote Script 2 excutor" camunda:delegateExpression="#{multiNodeDeployRemoteScript2ExecutorTaskDelegate}">
+ <bpmn:incoming>SequenceFlow_1b4e6j2</bpmn:incoming>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1b4e6j2" sourceRef="DeployRemoteexecutor" targetRef="ServiceTask_1fcq5wy" />
+ <bpmn:textAnnotation id="TextAnnotation_1p71e63">
+ <bpmn:text>Rest</bpmn:text>
+ </bpmn:textAnnotation>
+ <bpmn:association id="Association_0bjstyh" sourceRef="StartEvent_1" targetRef="TextAnnotation_1p71e63" />
+ <bpmn:textAnnotation id="TextAnnotation_00kckqx">
+ <bpmn:text>Script 1 execution Task</bpmn:text>
+ </bpmn:textAnnotation>
+ <bpmn:association id="Association_16sojmg" sourceRef="Task_19usii1" targetRef="TextAnnotation_00kckqx" />
+ <bpmn:textAnnotation id="TextAnnotation_08xc1st">
+ <bpmn:text>Win Scp Script Executor</bpmn:text>
+ </bpmn:textAnnotation>
+ <bpmn:association id="Association_05u86o6" sourceRef="Task_1jo0y1o" targetRef="TextAnnotation_08xc1st" />
+ <bpmn:textAnnotation id="TextAnnotation_071um3l">
+ <bpmn:text>Remote Script 1 Executor</bpmn:text>
+ </bpmn:textAnnotation>
+ <bpmn:association id="Association_0xluc8y" sourceRef="DeployRemoteexecutor" targetRef="TextAnnotation_071um3l" />
+ <bpmn:textAnnotation id="TextAnnotation_1xt9xdh">
+ <bpmn:text>Remote Script 2 executor</bpmn:text>
+ </bpmn:textAnnotation>
+ <bpmn:association id="Association_1yfo16k" sourceRef="ServiceTask_1fcq5wy" targetRef="TextAnnotation_1xt9xdh" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="multinodedeploy">
+ <bpmndi:BPMNEdge id="SequenceFlow_125l5l0_di" bpmnElement="SequenceFlow_125l5l0">
+ <di:waypoint x="330" y="278" />
+ <di:waypoint x="368" y="278" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="387" y="265" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="TextAnnotation_1p71e63_di" bpmnElement="TextAnnotation_1p71e63">
+ <dc:Bounds x="339" y="182" width="100" height="30" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="Association_0bjstyh_di" bpmnElement="Association_0bjstyh">
+ <di:waypoint x="324" y="265" />
+ <di:waypoint x="375" y="212" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="TextAnnotation_00kckqx_di" bpmnElement="TextAnnotation_00kckqx">
+ <dc:Bounds x="469" y="153" width="100" height="39" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="Association_16sojmg_di" bpmnElement="Association_16sojmg">
+ <di:waypoint x="456" y="238" />
+ <di:waypoint x="501" y="192" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
+ <dc:Bounds x="294" y="260" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="270" y="296" width="88" height="27" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_0y4nqij_di" bpmnElement="Task_19usii1">
+ <dc:Bounds x="368" y="238" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="TextAnnotation_08xc1st_di" bpmnElement="TextAnnotation_08xc1st">
+ <dc:Bounds x="805" y="153" width="100" height="42" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="Association_05u86o6_di" bpmnElement="Association_05u86o6">
+ <di:waypoint x="687" y="254" />
+ <di:waypoint x="811" y="195" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_0ek6xsx_di" bpmnElement="Task_1jo0y1o">
+ <dc:Bounds x="587" y="238" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1jh4nm3_di" bpmnElement="SequenceFlow_1jh4nm3">
+ <di:waypoint x="687" y="278" />
+ <di:waypoint x="797" y="278" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="704" y="265" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_0gdjdwl_di" bpmnElement="DeployRemoteexecutor">
+ <dc:Bounds x="797" y="238" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="TextAnnotation_071um3l_di" bpmnElement="TextAnnotation_071um3l">
+ <dc:Bounds x="986" y="159" width="100" height="39" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="Association_0xluc8y_di" bpmnElement="Association_0xluc8y">
+ <di:waypoint x="897" y="252" />
+ <di:waypoint x="1000" y="198" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_05ubysv_di" bpmnElement="SequenceFlow_05ubysv">
+ <di:waypoint x="468" y="278" />
+ <di:waypoint x="587" y="278" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ServiceTask_1fcq5wy_di" bpmnElement="ServiceTask_1fcq5wy">
+ <dc:Bounds x="1018" y="228" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1b4e6j2_di" bpmnElement="SequenceFlow_1b4e6j2">
+ <di:waypoint x="897" y="278" />
+ <di:waypoint x="958" y="278" />
+ <di:waypoint x="958" y="268" />
+ <di:waypoint x="1018" y="268" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="TextAnnotation_1xt9xdh_di" bpmnElement="TextAnnotation_1xt9xdh">
+ <dc:Bounds x="1118" y="148" width="100" height="41" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="Association_1yfo16k_di" bpmnElement="Association_1yfo16k">
+ <di:waypoint x="1108" y="228" />
+ <di:waypoint x="1148" y="189" />
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>