mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 09:00:18 +01:00 
			
		
		
		
	Fixes and tweaks on command execution.
This commit is contained in:
		
							parent
							
								
									5359a7afbd
								
							
						
					
					
						commit
						949750fc1e
					
				@ -84,7 +84,6 @@ class Mage_Console
 | 
				
			|||||||
        self::log('---------------------------------');
 | 
					        self::log('---------------------------------');
 | 
				
			||||||
        self::log('---- Executing: $ ' . $command);
 | 
					        self::log('---- Executing: $ ' . $command);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ob_start();
 | 
					 | 
				
			||||||
        $return = 1;
 | 
					        $return = 1;
 | 
				
			||||||
        $log = array();
 | 
					        $log = array();
 | 
				
			||||||
        exec($command . ' 2>&1', $log, $return);
 | 
					        exec($command . ' 2>&1', $log, $return);
 | 
				
			||||||
 | 
				
			|||||||
@ -29,11 +29,16 @@ class Mage_Task_BuiltIn_Scm_Clone
 | 
				
			|||||||
        $this->_runLocalCommand('mkdir -p ' . $this->_source['temporal']);
 | 
					        $this->_runLocalCommand('mkdir -p ' . $this->_source['temporal']);
 | 
				
			||||||
        switch ($this->_source['type']) {
 | 
					        switch ($this->_source['type']) {
 | 
				
			||||||
            case 'git':
 | 
					            case 'git':
 | 
				
			||||||
                $command = 'cd ' . $this->_source['temporal']
 | 
					                // Clone Repo
 | 
				
			||||||
                         . ' && '
 | 
					                $command = 'cd ' . $this->_source['temporal'] . ' ; '
 | 
				
			||||||
                         . 'git clone ' . $this->_source['repository'] . ' . '
 | 
					                         . 'git clone ' . $this->_source['repository'] . ' . ';
 | 
				
			||||||
                         . ' && '
 | 
					                $result = $this->_runLocalCommand($command);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                // Checkout Branch
 | 
				
			||||||
 | 
					                $command = 'cd ' . $this->_source['temporal'] . ' ; '
 | 
				
			||||||
                         . 'git checkout ' . $this->_source['from'];
 | 
					                         . 'git checkout ' . $this->_source['from'];
 | 
				
			||||||
 | 
					                $result = $result && $this->_runLocalCommand($command);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                $this->_config->setFrom($this->_source['temporal']);
 | 
					                $this->_config->setFrom($this->_source['temporal']);
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -42,8 +47,6 @@ class Mage_Task_BuiltIn_Scm_Clone
 | 
				
			|||||||
                break;
 | 
					                break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        $result = $this->_runLocalCommand($command);
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        return $result;
 | 
					        return $result;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -45,7 +45,7 @@ abstract class Mage_Task_TaskAbstract
 | 
				
			|||||||
            $releasesDirectory = '';
 | 
					            $releasesDirectory = '';
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        $localCommand = 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no '
 | 
					        $localCommand = 'ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no '
 | 
				
			||||||
                      . $this->_config->deployment('user') . '@' . $this->_config->getHost() . ' '
 | 
					                      . $this->_config->deployment('user') . '@' . $this->_config->getHost() . ' '
 | 
				
			||||||
                      . '"cd ' . rtrim($this->_config->deployment('to'), '/') . $releasesDirectory . ' && '
 | 
					                      . '"cd ' . rtrim($this->_config->deployment('to'), '/') . $releasesDirectory . ' && '
 | 
				
			||||||
                      . $command . '"';
 | 
					                      . $command . '"';
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user