text 用于远程部署的post-commit git示例

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 用于远程部署的post-commit git示例相关的知识,希望对你有一定的参考价值。

#!/bin/bash

#ref:https://www.digitalocean.com/community/tutorials/how-to-use-git-hooks-to-automate-development-and-deployment-tasks

while read oldrev newrev ref
do
    if [[ $ref =~ .*/master$ ]];
    then
        echo "Master ref received.  Deploying master branch to production..."
        git --work-tree=/var/www/html --git-dir=/home/demo/proj checkout -f
    else
        echo "Ref $ref successfully received.  Doing nothing: only the master branch may be deployed on this server."
    fi
done

以上是关于text 用于远程部署的post-commit git示例的主要内容,如果未能解决你的问题,请参考以下文章

svn hooks post-commit钩子自动部署

text git远程部署

SVN提交以后出现出现post-commit hook failed 是啥原因?

用于命令行的 Qt Creator 标准输入,可部署到远程 Linux 主机

linux svn post-commit 更新 我的svn post-commit 当ide提交时候可以执行,但是svn update 却没成功

text 用于本地远程服务器sqlbuddy.com的MysqlAdmin的替代方案