Skip to content

Instantly share code, notes, and snippets.

@victorlapshev
Created October 26, 2017 10:21
Show Gist options
  • Select an option

  • Save victorlapshev/a6e3cad5bc0993d3bc2ea0e6e094cdb1 to your computer and use it in GitHub Desktop.

Select an option

Save victorlapshev/a6e3cad5bc0993d3bc2ea0e6e094cdb1 to your computer and use it in GitHub Desktop.
<pre>
<?php
putenv('COMPOSER_HOME=/home/bitrix/.composer/');
$commands = [
'git add --all',
'git commit -m "Changes on production"',
'git pull origin master',
'git checkout --theirs .',
'git commit -am "Remote Conflict"',
'git push origin master',
'(cd local && composer update --no-dev --no-progress)', // update composer requirements
'rm -rf bitrix/cache/maximaster/tools.twig' // kill twig cache
];
foreach($commands AS $command){
$tmp = shell_exec($command." 2>&1 ");
echo '<b>' . $command . '</b>' . PHP_EOL;
echo htmlentities(trim($tmp)) . PHP_EOL . PHP_EOL;
}
?>
</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment