sh Git部署bash

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh Git部署bash相关的知识,希望对你有一定的参考价值。

#!/bin/bash
export GIT_WORK_TREE=/home/rnb/tester_site #Carpeta publica donde se copian los archivos
export GIT_DIR=/home/rnb/tester.git #Carpeta del repositorio git

while read oldrev newrev ref
do
    # only checking out the master (or whatever branch you would like to deploy)
    if [[ $ref =~ .*/master$ ]];
    then
        echo "-------------------------------------------------------------------------->"
        echo "--------------------- Actualizando rama MASTER --------------------------->"
        echo "-------------------------------------------------------------------------->"
        git --work-tree=$GIT_WORK_TREE --git-dir=$GIT_DIR checkout -f
        echo " "
        echo "-------------------------------------------------------------------------->"
        echo "---------------------- Actualizar composer ------------------------------->"
        echo "-------------------------------------------------------------------------->"
        cd $GIT_WORK_TREE
        composer update
        composer dump-autoload -o

    else
        echo "Ref $ref successfully received.  Doing nothing: only the master branch may be deployed on this server."
    fi
done

以上是关于sh Git部署bash的主要内容,如果未能解决你的问题,请参考以下文章

sh Git最新发布bash

sh GIT Bash配置

sh git的Bash别名

sh Git片段#tags:bash

sh Bash git别名。

sh su来git登录shell是git-bash。