this is my first time exploring webhook & autodeploy from gitlab to production server ( digital ocean )
I'll trigger an url ( http://example.com/git/hook/pull-master.php ) on webhook whenever I pushed files from my local machine.
and below are the codes of pull-master.php :
$cmd = "git pull https://usr:pwd@gitlab.com/johndoe/project.git master";
echo shell_exec($cmd);
May I know
- Above autodeploy method secure?
- Can production server have
.git
folders? assuming the project directory in .git approx. 100MB ~ 500MB
Are above autodeploy method safe? is this the usual way how developer autodeploy codes to their staging/production server?