TEst pull via sh
This commit is contained in:
		
							
								
								
									
										1
									
								
								helper/shell-gitpull.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								helper/shell-gitpull.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
cd .. && git pull origin master
 | 
			
		||||
@@ -24,6 +24,16 @@ return [
 | 
			
		||||
                    ],
 | 
			
		||||
                ],
 | 
			
		||||
            ],
 | 
			
		||||
            'srcpull' => [
 | 
			
		||||
                'type' => Literal::class,
 | 
			
		||||
                'options' => [
 | 
			
		||||
                    'route'    => '/pull',
 | 
			
		||||
                    'defaults' => [
 | 
			
		||||
                        'controller' => Controller\IndexController::class,
 | 
			
		||||
                        'action'     => 'pull',
 | 
			
		||||
                    ],
 | 
			
		||||
                ],
 | 
			
		||||
            ],
 | 
			
		||||
            'contact' => [
 | 
			
		||||
                'type' => Literal::class,
 | 
			
		||||
                'options' => [
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,26 @@ use PHPMailer\PHPMailer\Exception;
 | 
			
		||||
class IndexController extends AbstractActionController
 | 
			
		||||
{
 | 
			
		||||
    public function indexAction()
 | 
			
		||||
    {   $view = new ViewModel();
 | 
			
		||||
    {
 | 
			
		||||
        $view = new ViewModel();
 | 
			
		||||
        $view->setTerminal(true);
 | 
			
		||||
        return $view;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function pullAction()
 | 
			
		||||
    {
 | 
			
		||||
        $view = new JsonModel();
 | 
			
		||||
        $old_path = getcwd();
 | 
			
		||||
 | 
			
		||||
        var_dump($old_path);
 | 
			
		||||
        var_dump($old_path.'/helper');
 | 
			
		||||
 | 
			
		||||
        chdir($old_path.'/helper' );
 | 
			
		||||
//make sure to make the shell file executeable first before running the shell_exec function
 | 
			
		||||
        $output = shell_exec('./shell-gitpull.sh');
 | 
			
		||||
        var_dump($output);
 | 
			
		||||
        echo $output;
 | 
			
		||||
        die;
 | 
			
		||||
        $view->setTerminal(true);
 | 
			
		||||
        return $view;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user