{"id":21499193,"url":"https://github.com/node-link/cakephp-git-deploy","last_synced_at":"2026-04-11T07:36:24.558Z","repository":{"id":57027973,"uuid":"150378863","full_name":"node-link/cakephp-git-deploy","owner":"node-link","description":"Plugin to operate automatic git-pull server with CakePHP 3 (Using WebHook from GitHub, GitLab and Bitbucket)","archived":false,"fork":false,"pushed_at":"2018-10-09T10:46:36.000Z","size":2103,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-08T20:53:10.850Z","etag":null,"topics":["bitbucket","cakephp","cakephp-plugin","git","github","gitlab","webhook"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/node-link.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-26T06:29:59.000Z","updated_at":"2020-07-15T20:26:44.000Z","dependencies_parsed_at":"2022-08-23T16:30:12.652Z","dependency_job_id":null,"html_url":"https://github.com/node-link/cakephp-git-deploy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/node-link/cakephp-git-deploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-link%2Fcakephp-git-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-link%2Fcakephp-git-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-link%2Fcakephp-git-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-link%2Fcakephp-git-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-link","download_url":"https://codeload.github.com/node-link/cakephp-git-deploy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-link%2Fcakephp-git-deploy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31673067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitbucket","cakephp","cakephp-plugin","git","github","gitlab","webhook"],"created_at":"2024-11-23T17:10:06.060Z","updated_at":"2026-04-11T07:36:24.542Z","avatar_url":"https://github.com/node-link.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitDeploy plugin for CakePHP\n\nPlugin to operate automatic git-pull server with CakePHP 3 (Using WebHook from GitHub, GitLab and Bitbucket)\n\n## Requirements\n\n* CakePHP 3.5 or later\n* PHP 5.6 or later\n\n## Installation\n\n### 1. Install plugin\n\nYou can install this plugin into your CakePHP application using [composer](http://getcomposer.org).\n\nThe recommended way to install composer packages is:\n\n```\ncomposer require node-link/cakephp-git-deploy\n```\n\n### 2. Load plugin\n\nPlease load the plugin manually as follows:\n\n```php\n\u003c?php\n// In src/Application.php. Requires at least 3.6.0\nuse Cake\\Http\\BaseApplication;\n\nclass Application extends BaseApplication\n{\n    public function bootstrap()\n    {\n        parent::bootstrap();\n\n        // Load the plugin\n        $this-\u003eaddPlugin('NodeLink/GitDeploy');\n    }\n}\n```\n\nPrior to 3.6.0, you should use `Plugin::load()`:\n\n```php\n\u003c?php\n// In config/bootstrap.php\n\nuse Cake\\Core\\Plugin;\n\nPlugin::load('NodeLink/GitDeploy', ['bootstrap' =\u003e true, 'routes' =\u003e true]);\n```\n\nOr, use `bin/cake` to load the plugin as follows:\n\n```bash\nbin/cake plugin load -b -r NodeLink/GitDeploy\n```\n\n## Configuration\n\nEdit `config/.env` or `config/app.php`.\n\nThe full default configuration is as follows:\n\n```php\n\u003c?php\nreturn [\n    'GitDeploy' =\u003e [\n        'enable' =\u003e filter_var(env('GIT_DEPLOY_ENABLE', false), FILTER_VALIDATE_BOOLEAN),\n        'token' =\u003e env('GIT_DEPLOY_TOKEN', 'secret'),\n        'branch' =\u003e env('GIT_DEPLOY_BRANCH', 'master'),\n        'git_path' =\u003e env('GIT_DEPLOY_GIT_PATH', '/usr/bin/git'),\n        'composer_path' =\u003e env('GIT_DEPLOY_COMPOSER_PATH', '/usr/local/bin/composer')\n    ],\n];\n```\n\nIt is recommended to add following items to `config/.env`.\n\n```bash\nexport GIT_DEPLOY_ENABLE=\"true\"\nexport GIT_DEPLOY_TOKEN=\"__TOKEN__\"\nexport GIT_DEPLOY_BRANCH=\"master\"\nexport GIT_DEPLOY_GIT_PATH=\"/usr/bin/git\"\nexport GIT_DEPLOY_COMPOSER_PATH=\"/usr/local/bin/composer\"\nexport COMPOSER_HOME=\"/var/www\"\n```\n\nIt may not work unless `COMPOSER_HOME` is set correctly.\n\n## Settings\n\n### GitHub\n\nIn your repository, navigate to Settings \u0026rarr; Webhooks \u0026rarr; Add webhook, and use the following settings:\n\n* Payload URL: https://example.com/git-deploy\n* Content type: application/json\n* Secret: The value of `GIT_DEPLOY_TOKEN` in `config/.env`\n* Which events would you like to trigger this webhook?: :radio_button: Just the push event\n* Active: :ballot_box_with_check:\n\nClick \"Add webhook\" to save your settings, and the script should start working.\n\n![Example screenshot showing GitHub webhook settings](./github-webhook-settings.png)\n\n### GitLab\n\nIn your repository, navigate to Settings \u0026rarr; Integrations, and use the following settings:\n\n* URL: https://example.com/git-deploy\n* Secret Token: The value of `GIT_DEPLOY_TOKEN` in `config/.env`\n* Trigger: :ballot_box_with_check: Push events\n* Enable SSL verification: :ballot_box_with_check: (only if using SSL, see [GitLab's documentation](https://gitlab.com/help/user/project/integrations/webhooks#ssl-verification) for more details)\n\nClick \"Add webhook\" to save your settings, and the script should start working.\n\n![Example screenshot showing GitLab webhook settings](./gitlab-webhook-settings.png)\n\n### Bitbucket\n\nIn your repository, navigate to Settings \u0026rarr; Webhooks \u0026rarr; Add webhook, and use the following settings:\n\n* Title: Git Deploy\n* URL: https://example.com/git-deploy?token= `GIT_DEPLOY_TOKEN`\n* Active: :ballot_box_with_check:\n* SSL / TLS: :white_large_square: Skip certificate verification (only if using SSL, see [Bitbucket's documentation](https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html#ManageWebhooks-skip_certificate) for more details)\n* Triggers: :radio_button: Repository push\n\nClick \"Save\" to save your settings, and the script should start working.\n\n![Example screenshot showing Bitbucket webhook settings](./bitbucket-webhook-settings.png)\n\n## Trouble Shooting\n\nIf execution is not successful, please refer to `logs/error.log` and `logs/debug.log`.\n\nDetails of the error at the time of execution may be listed in some cases.\n\n### Permissions\n\nWhen it does not work well, in many cases, there is a problem with permissions.\n\nPlease set so that the web server user (`www`, `www-data`, `apache`, etc...) can `git pull` and `composer install`.\n\nIt is suggested this be accomplished by changing the repository group to the web server user's and giving the group write permissions:\n\n1. Open a terminal to the directory containing the repository on the server.\n2. run `sudo chown -R yourusername:webserverusername project-dir/` to change the group of the repo.\n3. run `sudo chmod -R g+s project-dir/` to make the group assignment inherited for new files/dirs.\n4. run `sudo chmod -R 775 project-dir/` to set read \u0026 write for both owner and group.\n\n### SSH\n\nGenerate an SSH key and add it to your account so that git pull can be run without a password.\n\n* [GitHub documentation](https://help.github.com/articles/connecting-to-github-with-ssh/)\n* [GitLab documentation](https://docs.gitlab.com/ce/ssh/README.html)\n* [Bitbucket documentation](https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html)\n\n## Reporting Issues\n\nIf you have a problem with the GitDeploy plugin, please send a pull request or open an issue on [GitHub](https://github.com/node-link/cakephp-git-deploy/issues).\n\nAlso, I would appreciate it if you contribute to updating `README.md` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-link%2Fcakephp-git-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-link%2Fcakephp-git-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-link%2Fcakephp-git-deploy/lists"}