zoukankan      html  css  js  c++  java
  • githook.php推送代码到服务器

    <?php
    
    // $cmd = "cd  /www/wwwroot/fj.com/thinkphp5/  && sudo git reset --hard origin/cs && sudo git pull origin cs && sudo git pull --all && sudo git pull origin cs  2>&1";
    // $cmd = "cd  /www/wwwroot/nwnd_php2/  &&sudo  git fetch --all &&sudo  git reset --hard origin master && sudo git pull --all && sudo git pull origin master  2>&1";
    // $cmd = "cd  /www/wwwroot/nwnd_php2/  && sudo git pull origin  cs      2>&1";
    
    $cmd = "cd /www/wwwroot/test/thinkphp5_test_project/ && git pull 2>&1";
    
    $res = array();
    exec($cmd,$res,$i);
    var_dump($res);
    
    
    
     echo '</br>';
    
    // $ip = "www.baidu.com";
    // exec("curl $ip ", $arr, $i);
    //   echo "信息:<br />";
    //   print("<xmp>");
    // print_r($arr);
    //   print("</xmp>");
    echo "状态:".$i."<br />";
      echo "PS:状态0为执行成功,1为执行失败!";
    ?>





    <?php

    $cmd = "cd /www/wwwroot/new.zaomz.com/nwnd_php/ &&sudo git reset --hard origin/pt && sudo git pull origin pt && sudo git pull --all && sudo git pull origin pt 2>&1";
    //$cmd = "cd /www/wwwroot/new.zaomz.com/nwnd_php/ &&sudo git log &&sudo git pull --all && sudo git pull origin master 2>&1";
    //$cmd = "cd /www/wwwroot/new.zaomz.com/nwnd_php/ &&sudo git fetch --all &&sudo git reset --hard origin/pt && sudo git pull --all && sudo git pull origin pt 2>&1";

    $res = array();
    exec($cmd,$res);

    var_dump($res);
    ?>

      

  • 相关阅读:
    php中file_get_contents的图片乱码
    Lsh and Rsh (左移和右移)
    |=的含义
    Intercultural Communication Drama
    VS代码块快速折叠快捷键
    C++sqrt()函数与sqrtf()函数的区别
    C++中union和struct之间的区别
    泛型编程
    生成百度网盘目录文件
    字符串前L的含义
  • 原文地址:https://www.cnblogs.com/ygyy/p/12649934.html
Copyright © 2011-2022 走看看