Hi,
I have figured how to implement an auto-deploy from Github.
First we cloned the Github repo into Cpanel dir
Second an Cronjob run a file "deploy.sh" every minute to update /public_html by copying local repo files into public.
It works, but it have some issues...
Deploy.sh code snippet:
I had my Cpanel updated, so the code doesn't work as used to. Now it run and update everything always when cron runs.
I used to use this line to verify when to run and update /public_html
And now it is bypassing.
Any ideas?
Thanks!
I have figured how to implement an auto-deploy from Github.
First we cloned the Github repo into Cpanel dir
Second an Cronjob run a file "deploy.sh" every minute to update /public_html by copying local repo files into public.
It works, but it have some issues...
Deploy.sh code snippet:
Bash:
(cd ${REPO_DIR} && git pull | grep 'Already up to date.') > /dev/null 2>&1
if [[ ${?} == 0 ]]; then
# Verifica se a pasta de destino já contem uma instalação válida
if [[ -f ${DEPLOY_DIR}/index.php ]]; then
output "Up to date"
exit 0
fi
fi
I used to use this line to verify when to run and update /public_html
Code:
git pull | grep 'Already up to date.'
Any ideas?
Thanks!