i am trying to go over a code someone once did in our organization and now he is gone and no one can help me with that. we have an auto-deployment PHP scripts in the server to help us sync the server with github whenever a push is made (webhooks). it used to work fine but suddenly it stopped working... with my very little experience with this kind of procedures, i have found the PHP code in the server that should work when a push is made in github and basically it should do the whole procedure of auto-deployment. the problem is that i went over the code and i noticed something weird;
if ($payload->ref === 'refs/heads/development')
{ echo 'received updated in dev branch; bash/deploy_frontend2dev.sh ';
exec('sh /var/www/html/bash/deploy_frontend2dev.sh', $output);
var_dump($output);
}
else
echo 'smth is called';
the "else" here is without any curly braces. i know there is a way to do an "if" statement without the curly braces but is it working with only one part of it without the braces?
also if you would like this is the code from the "exec":
cd /var/www/html/ezmob-frontend/;
#echo "/var/www/html/ezmob-frontend/";
git pull origin development;
echo "pulling file from dev branch";
rm -R ../dashboard;
echo "dashboard is updated";
unzip ezmob-frontend-built.zip -d ../;
#echo "dashboard is updated";
chmod 777 -R dashboard;
note that we didn't change nothing from when it worked but still suddenly it stopped auto-deploying...
thanks.