ahmeti/laravel-auto-git-pull

Laravel 自动 Git 拉取

dev-master 2018-02-03 16:39 UTC

This package is auto-updated.

Last update: 2024-09-27 01:38:54 UTC


README

.env 变量

AUTO_PULL_SECRET=xxxxxxxxxxxxxxxxxx
AUTO_PULL_DIR=/var/www/site.com
AUTO_PULL_SERVER_IP=111.11.111.111
AUTO_PULL_SSH_USER=root
AUTO_PULL_SSH_PRIVATE_KEY=storage/app/id_rsa
AUTO_PULL_SSH_USER_PASS=

在 api.php 中添加路由

Route::any('/auto-git-pull', '\Ahmeti\LaravelAutoGitPull\LaravelAutoGitPullController@pull');

在 Bitbucket.com 上创建 Webhook URL

http://site.com/api/auto-git-pull?secret=xxxxxxxxxxxxxxxxxx

结果

{
    "status": true,
    "message": "Success!",
    "data": [
        "No local changes to save",
        "Already up-to-date."
    ],
    "errors": [
        
    ]
}