Exemple #1
0
        static public IsshBRidgeCommand constructBridge(sshCommandConfig BridgeConfiguration)
        {
            Assembly          myAssembly1 = Assembly.LoadFrom(BridgeConfiguration.BridgePath);
            Type              myType      = myAssembly1.GetType(BridgeConfiguration.BridgeName);
            IsshBRidgeCommand theBridge   = (IsshBRidgeCommand)Activator.CreateInstance(myType);

            theBridge.sshConfiguration = BridgeConfiguration;
            return(theBridge);
        }
Exemple #2
0
        public override void HandleExecute(ChainRequest request)
        {
            myRequest = (ButlerProcessRequest)request;

            sshCommandConfig myConfig = Newtonsoft.Json.JsonConvert.DeserializeObject <sshCommandConfig>(this.StepConfiguration);

            myBridge = sshCommandStep.constructBridge(myConfig);

            string exitCode         = string.Format(ExitCodePatter, myRequest.ProcessInstanceId);
            string customSshCommand = myBridge.buildCommand(sshCommandStep.internalValues(myRequest), myRequest.MetaData);

            myBridge.WaitForProcessEnd(customSshCommand, exitCode, myRequest.ProcessInstanceId);
            myRequest.Log.Add(string.Format("[0] finish to execute at {1} ------------------------------", myRequest.ProcessInstanceId, DateTime.Now.ToString()));
        }
Exemple #3
0
        public override void HandleExecute(ChainRequest request)
        {
            myRequest   = (ButlerProcessRequest)request;
            blobManager = BlobManagerFactory.CreateBlobManager(myRequest.ProcessConfigConn);

            sshCommandConfig myConfig = Newtonsoft.Json.JsonConvert.DeserializeObject <sshCommandConfig>(this.StepConfiguration);

            myBridge = sshCommandStep.constructBridge(myConfig);

            string customSshCommand = myBridge.buildCommand(sshCommandStep.internalValues(myRequest), myRequest.MetaData);

            myRequest.Log.Add(string.Format("[0] Start to execute at {1} Command {2}", myRequest.ProcessInstanceId, DateTime.Now.ToString(), customSshCommand));

            myBridge.execCommand(customSshCommand);

            string message = string.Format("[{0}] {3}  Result {1}: {2}", myRequest.ProcessInstanceId, myBridge.ResultCode, myBridge.Result, DateTime.Now.ToString());

            myRequest.Log.Add(message);
        }