在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:vicenteguerra/git-deploy开源软件地址:https://github.com/vicenteguerra/git-deploy开源编程语言:PHP 100.0%开源软件介绍:git-deployA PHP script to automatically pull from a repository to a web server (using a webhook on GitHub, GitLab, or Bitbucket). You can configure which branch this script pulls from. This script is useful for both development and production servers. On your serverSSHGenerate an SSH key and add it to your account so that ConfigurationCopy the git-deploy folder and its contents in to your public folder (typically public_html). Note that you can change the name of the folder if desired. Rename git-deploy/deploy.sample.php to git-deploy/deploy.php, and update each variable to a value that suits your needs. Multiple copies of git-deploy/deploy.sample.php can be made for multiple projects or versions (you just need to change the webhook url to match the new name). An example of a live configuration is below. define("TOKEN", "secret-token");
define("REMOTE_REPOSITORY", "[email protected]:username/custom-project.git");
define("DIR", "/var/www/vhosts/repositories/custom-project");
define("BRANCH", "refs/heads/master");
define("LOGFILE", "deploy.log");
define("GIT", "/usr/bin/git");
define("MAX_EXECUTION_TIME", 180);
define("BEFORE_PULL", "/usr/bin/git reset --hard @{u}");
define("AFTER_PULL", "/usr/bin/node ./node_modules/gulp/bin/gulp.js default"); PermissionsWhen deploy.php is called by the web-hook, the webserver user (
On GitHub | GitLab | BitbucketGitHubIn your repository, navigate to Settings → Webhooks → Add webhook, and use the following settings:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论