Simple tools for git auto deploy in linux
|
9 năm trước cách đây | |
---|---|---|
README.md | 9 năm trước cách đây | |
auto_deploy.sh | 9 năm trước cách đây | |
index.php | 9 năm trước cách đây | |
post-receive.sample | 9 năm trước cách đây |
Simple tools for git auto deploy in linux
Copy the contents in post-receive.sample to your server's hooks, you may replace the url
and token
with your own settings
Put the files auto_deploy.sh
and index.php
to your website in the same directory. For example, you may access index.php
from the url http://myweb.com/auto_deploy/index.php
, also it is to-post url in the githooks
Replace your deploy path in auto_deploy.sh
by setting the path value
Replace your toCheckToken
and validIP
in index.php
Web user should have permission to run the git command!
Let's say that your nginx
user is www
(of course you can check this by exec(whoami)
), and it's recommended ssh key of www
should be added to this project's SSH deploy key.
For example:
sudo -u www ssh-keygen -t rsa -C "YOUR_COMMENT"
Use above suggestion incase your web user is set to nologin via ssh
Just with the text [deploy]
included in your commit message, like
git commit -m "Bug fix [deploy]"
git push
Remote handle message may show to you while pushing.
exec
function is required in php.ini