Skip to content

Instantly share code, notes, and snippets.

@purplefish32
Created July 3, 2013 15:01
Show Gist options
  • Save purplefish32/5918954 to your computer and use it in GitHub Desktop.
Save purplefish32/5918954 to your computer and use it in GitHub Desktop.
Symfony deploy script
#!/bin/bash
cd ..
git fetch origin
git checkout origin/master
cd deploy/
rm composer.phar
curl -sS https://getcomposer.org/installer | php
cd ..
php deploy/composer.phar install
php app/console innova:dev-fixtures:load
php app/console assets:install --symlink
php app/console assetic:dump
php app/console cache:clear --env=prod --no-debug
echo '
_____
(__) / \
(@o) ( Done! )
/-------\/ --" \_____/
/ | ||
* ||----||
^^ ^^
'
<?php
try
{
$payload = json_decode($_REQUEST['payload']);
}
catch(Exception $e)
{
exit(0);
}
//log the request
file_put_contents('../deploy/logs/github.log', print_r($payload, TRUE), FILE_APPEND);
if ($payload->ref === 'refs/heads/master')
{
// path to your site deployment script
exec('../deploy.sh > ../deploy/logs/php-deploy.log');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment