2019-10-22 09:50:54 +00:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
|
|
|
|
2020-01-15 08:14:44 +00:00
|
|
|
/**
|
2020-04-29 11:12:27 +00:00
|
|
|
* Usage: git publish
|
2020-01-15 08:14:44 +00:00
|
|
|
*/
|
|
|
|
|
2020-04-29 11:12:27 +00:00
|
|
|
$currentBranch = exec('git rev-parse --abbrev-ref HEAD');
|
2020-01-15 02:20:21 +00:00
|
|
|
|
2020-04-29 11:12:27 +00:00
|
|
|
if (in_array($currentBranch, ['develop', 'master', 'staging', 'production'])) {
|
|
|
|
print "Currently on ${currentBranch}. Aborting.";
|
2020-01-15 02:20:21 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2020-04-29 11:12:27 +00:00
|
|
|
exec("git push -u origin $currentBranch:opd-{$currentBranch}");
|