Open anibalsanchez opened 3 years ago
I agree the idea here (and the reason for this plugin) is that you want to do it that way and that you want to use github webhooks. This way it also allows people to setup a git deploy without messing arround with shell scripts themself.
When you have a deploy script like you mention a simple git pull does not work anyway.
But to me this does not sound like a direct issue with the plugin just another way to do git deploys right?
I think that the value proposition of the plugin to ease the configuration of deployments is OK.
The only issue is the way of executing the deployment.
I would add the alternative to execute the deployment as a command line with a cron job (to avoid the execution of a long task in the webserver context, that could potentially break the site if it fails).
Thanks will take a look into it. i'm not sure yet how to trigger a cli script on a github hook but will take a look into it and maybe adding a option to trigger a custom build / deploy script.
This the post-merge
that we execute on JED with a cronjob: https://github.com/joomla/jed-dev/blob/develop/hooks/post-merge
This is the cronjob: https://github.com/joomla/jed-dev/blob/develop/jed-git-hook-ci.sh
This is the crontab: https://github.com/joomla/jed-dev/blob/develop/crontab#L14
Will take a look into that thanks!
Hi Tobias,
This is more of general feedback than an issue itself. I understand that the method of executing commands with
shell_exec
works in theonAfterRoute
.My feedback in more in line with the recommendation to avoid using
onAfterRoute
for stuff that it is outside than what the web server should be doing (serving web pages). Since the web server has a configuration / security profile to serve pages, it can easily break the execution of a deployment.Back to the extension, I would suggest a Cronjob execution with a CLI in the /file folder to execute the deployment.
Something like what Laravel does with the
artisan
commands. This is a script that I use as a deployment cron job:Hope this helps! Let us know if there is anything else we can do.