@@ -36,11 +36,11 @@ |
||
| 36 | 36 | |
| 37 | 37 | private function registerDeployCommands() |
| 38 | 38 | { |
| 39 | - $this->app->singleton('command.morphatic.deployinit', function ($app) { |
|
| 39 | + $this->app->singleton('command.morphatic.deployinit', function($app) { |
|
| 40 | 40 | return $app['Morphatic\AutoDeploy\Commands\DeployInitCommand']; |
| 41 | 41 | }); |
| 42 | 42 | |
| 43 | - $this->app->singleton('command.morphatic.deployinfo', function ($app) { |
|
| 43 | + $this->app->singleton('command.morphatic.deployinfo', function($app) { |
|
| 44 | 44 | return $app['Morphatic\AutoDeploy\Commands\DeployInfoCommand']; |
| 45 | 45 | }); |
| 46 | 46 | |
@@ -45,7 +45,6 @@ |
||
| 45 | 45 | /** |
| 46 | 46 | * Determine the origin of a deploy request. |
| 47 | 47 | * |
| 48 | - * @param Illuminate\Http\Request $request The Request object. |
|
| 49 | 48 | * |
| 50 | 49 | * @return \Morphatic\AutoDeploy\Origins\OriginInterface An object corresponding to the origin type or null. |
| 51 | 50 | */ |
@@ -14,7 +14,6 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * Determines whether or not the Request originated from Github. |
| 16 | 16 | * |
| 17 | - * @param Illuminate\Http\Request $this->request The Request object |
|
| 18 | 17 | * |
| 19 | 18 | * @return bool Returns true if the request originated from Github. False otherwise. |
| 20 | 19 | */ |
@@ -36,9 +35,8 @@ discard block |
||
| 36 | 35 | * |
| 37 | 36 | * Follows the procedure described here: https://developer.github.com/webhooks/securing/ |
| 38 | 37 | * |
| 39 | - * @param Illuminate\Http\Request $this->request The Request object |
|
| 40 | 38 | * |
| 41 | - * @return bool Returns true if the request is authentic. False otherwise. |
|
| 39 | + * @return null|boolean Returns true if the request is authentic. False otherwise. |
|
| 42 | 40 | */ |
| 43 | 41 | public function verify() |
| 44 | 42 | { |
@@ -55,7 +53,6 @@ discard block |
||
| 55 | 53 | /** |
| 56 | 54 | * Gets the event the triggered the webhook request. |
| 57 | 55 | * |
| 58 | - * @param Illuminate\Http\Request $this->request The Request object |
|
| 59 | 56 | * |
| 60 | 57 | * @return string The name of the event, e.g. push, release, create, etc. |
| 61 | 58 | */ |
@@ -67,7 +64,6 @@ discard block |
||
| 67 | 64 | /** |
| 68 | 65 | * Gets the URL to be cloned from. |
| 69 | 66 | * |
| 70 | - * @param Illuminate\Http\Request $request The Request object |
|
| 71 | 67 | * |
| 72 | 68 | * @return string The URL of the repo. |
| 73 | 69 | */ |
@@ -79,7 +75,6 @@ discard block |
||
| 79 | 75 | /** |
| 80 | 76 | * Gets the ID of the commit that is to be cloned. |
| 81 | 77 | * |
| 82 | - * @param Illuminate\Http\Request $request The Request object |
|
| 83 | 78 | * |
| 84 | 79 | * @return string The commit ID. |
| 85 | 80 | */ |
@@ -7,7 +7,6 @@ discard block |
||
| 7 | 7 | /** |
| 8 | 8 | * Determines whether or not the Request originated from the webhook origin. |
| 9 | 9 | * |
| 10 | - * @param Illuminate\Http\Request $request The Request object |
|
| 11 | 10 | * |
| 12 | 11 | * @return bool Returns true if the request originated from this origin. False otherwise. |
| 13 | 12 | */ |
@@ -16,7 +15,6 @@ discard block |
||
| 16 | 15 | /** |
| 17 | 16 | * Verifies the authenticity of a webhook request from the origin. |
| 18 | 17 | * |
| 19 | - * @param Illuminate\Http\Request $request The Request object |
|
| 20 | 18 | * |
| 21 | 19 | * @return bool Returns true if the request is authentic. False otherwise. |
| 22 | 20 | */ |
@@ -25,7 +23,6 @@ discard block |
||
| 25 | 23 | /** |
| 26 | 24 | * Gets the event the triggered the webhook request. |
| 27 | 25 | * |
| 28 | - * @param Illuminate\Http\Request $request The Request object |
|
| 29 | 26 | * |
| 30 | 27 | * @return string The name of the event, e.g. push, release, create, etc. |
| 31 | 28 | */ |
@@ -34,7 +31,6 @@ discard block |
||
| 34 | 31 | /** |
| 35 | 32 | * Gets the URL to be cloned from. |
| 36 | 33 | * |
| 37 | - * @param Illuminate\Http\Request $request The Request object |
|
| 38 | 34 | * |
| 39 | 35 | * @return string The URL of the repo. |
| 40 | 36 | */ |
@@ -43,7 +39,6 @@ discard block |
||
| 43 | 39 | /** |
| 44 | 40 | * Gets the ID of the commit that is to be cloned. |
| 45 | 41 | * |
| 46 | - * @param Illuminate\Http\Request $request The Request object |
|
| 47 | 42 | * |
| 48 | 43 | * @return string The commit ID. |
| 49 | 44 | */ |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Morphatic\AutoDeploy\Commands; |
| 4 | 4 | |
| 5 | -use Illuminate\Support\Str; |
|
| 6 | 5 | use Illuminate\Console\Command; |
| 6 | +use Illuminate\Support\Str; |
|
| 7 | 7 | use Symfony\Component\Console\Input\InputOption; |
| 8 | 8 | |
| 9 | 9 | class DeployInitCommand extends Command |
@@ -32,9 +32,9 @@ |
||
| 32 | 32 | $route = $this->getRandomKey($this->laravel['config']['app.cipher']); |
| 33 | 33 | $url = parse_url(config('app.url'), PHP_URL_HOST); |
| 34 | 34 | $msg = "Here is the information you'll need to set up your webhook:\n\n". |
| 35 | - "Payload URL: <comment>https://$url/{$route[1]}</comment>\n". |
|
| 36 | - "Secret: <comment>{$secret[1]}</comment>\n\n". |
|
| 37 | - "You can display this information again by running `php artisan deploy:info`\n"; |
|
| 35 | + "Payload URL: <comment>https://$url/{$route[1]}</comment>\n". |
|
| 36 | + "Secret: <comment>{$secret[1]}</comment>\n\n". |
|
| 37 | + "You can display this information again by running `php artisan deploy:info`\n"; |
|
| 38 | 38 | |
| 39 | 39 | if ($this->option('show')) { |
| 40 | 40 | return $this->line($msg); |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | /** |
| 76 | 76 | * Create a new DeployController instance. |
| 77 | 77 | * |
| 78 | - * @param Morphatic\AutoDeploy\Origins\OriginInterface $origin The origin of the webhook |
|
| 79 | - * @param AdamBrett\ShellWrapper\Runners\Exec $exec The shell command execution class |
|
| 78 | + * @param OriginInterface $origin The origin of the webhook |
|
| 79 | + * @param Exec $exec The shell command execution class |
|
| 80 | 80 | */ |
| 81 | 81 | public function __construct(OriginInterface $origin, Exec $exec) |
| 82 | 82 | { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | /** |
| 132 | 132 | * Runs a shell command, logs, and handles the result. |
| 133 | 133 | * |
| 134 | - * @param AdamBrett\ShellWrapper\CommandInterface $cmd The text of the command to be run |
|
| 134 | + * @param CommandInterface $cmd The text of the command to be run |
|
| 135 | 135 | * |
| 136 | 136 | * @return bool True if the command was successful, false on error |
| 137 | 137 | */ |
@@ -2,16 +2,15 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Morphatic\AutoDeploy\Controllers; |
| 4 | 4 | |
| 5 | -use Log; |
|
| 6 | -use Mail; |
|
| 7 | -use Monolog\Logger; |
|
| 8 | -use Illuminate\Http\Request; |
|
| 9 | -use Illuminate\Routing\Controller; |
|
| 10 | 5 | use AdamBrett\ShellWrapper\Command\Builder as Command; |
| 11 | 6 | use AdamBrett\ShellWrapper\Command\CommandInterface; |
| 12 | 7 | use AdamBrett\ShellWrapper\Runners\Exec; |
| 8 | +use Illuminate\Routing\Controller; |
|
| 9 | +use Log; |
|
| 10 | +use Mail; |
|
| 13 | 11 | use Monolog\Formatter\HtmlFormatter; |
| 14 | 12 | use Monolog\Handler\SwiftMailerHandler; |
| 13 | +use Monolog\Logger; |
|
| 15 | 14 | use Morphatic\AutoDeploy\Origins\OriginInterface; |
| 16 | 15 | |
| 17 | 16 | class DeployController extends Controller |
@@ -117,7 +117,7 @@ |
||
| 117 | 117 | 'Timestamp' => date('r'), |
| 118 | 118 | 'output' => '', |
| 119 | 119 | ]; |
| 120 | - $whitelist = ['backupDatabase','pull','composer','npm','migrate','seed','deploy']; |
|
| 120 | + $whitelist = ['backupDatabase', 'pull', 'composer', 'npm', 'migrate', 'seed', 'deploy']; |
|
| 121 | 121 | foreach ($steps as $step) { |
| 122 | 122 | if (in_array($step, $whitelist) && !$this->{$step}()) { |
| 123 | 123 | $this->log->error('Deploy failed.', $this->result); |
@@ -7,7 +7,6 @@ discard block |
||
| 7 | 7 | /** |
| 8 | 8 | * Determines whether or not the Request originated from the webhook origin. |
| 9 | 9 | * |
| 10 | - * @param Illuminate\Http\Request $request The Request object |
|
| 11 | 10 | * |
| 12 | 11 | * @return bool Returns true if the request originated from this origin. False otherwise. |
| 13 | 12 | */ |
@@ -16,7 +15,6 @@ discard block |
||
| 16 | 15 | /** |
| 17 | 16 | * Verifies the authenticity of a webhook request from the origin. |
| 18 | 17 | * |
| 19 | - * @param Illuminate\Http\Request $request The Request object |
|
| 20 | 18 | * |
| 21 | 19 | * @return bool Returns true if the request is authentic. False otherwise. |
| 22 | 20 | */ |
@@ -25,7 +23,6 @@ discard block |
||
| 25 | 23 | /** |
| 26 | 24 | * Gets the event the triggered the webhook request. |
| 27 | 25 | * |
| 28 | - * @param Illuminate\Http\Request $request The Request object |
|
| 29 | 26 | * |
| 30 | 27 | * @return string The name of the event, e.g. push, release, create, etc. |
| 31 | 28 | */ |
@@ -34,7 +31,6 @@ discard block |
||
| 34 | 31 | /** |
| 35 | 32 | * Gets the URL to be cloned from. |
| 36 | 33 | * |
| 37 | - * @param Illuminate\Http\Request $request The Request object |
|
| 38 | 34 | * |
| 39 | 35 | * @return string The URL of the repo. |
| 40 | 36 | */ |
@@ -43,7 +39,6 @@ discard block |
||
| 43 | 39 | /** |
| 44 | 40 | * Gets the ID of the commit that is to be cloned. |
| 45 | 41 | * |
| 46 | - * @param Illuminate\Http\Request $request The Request object |
|
| 47 | 42 | * |
| 48 | 43 | * @return string The commit ID. |
| 49 | 44 | */ |
@@ -36,9 +36,9 @@ |
||
| 36 | 36 | preg_match('/AUTODEPLOY_ROUTE=(\S+)/', $env_content, $route)) { |
| 37 | 37 | $url = parse_url(config('app.url'), PHP_URL_HOST); |
| 38 | 38 | $message = "Here is the information you'll need to set up your webhook:\n\n". |
| 39 | - "Payload URL: <comment>https://$url/{$route[1]}</comment>\n". |
|
| 40 | - "Secret: <comment>{$secret[1]}</comment>\n\n". |
|
| 41 | - "You can display this information again by running `php artisan deploy:info`\n"; |
|
| 39 | + "Payload URL: <comment>https://$url/{$route[1]}</comment>\n". |
|
| 40 | + "Secret: <comment>{$secret[1]}</comment>\n\n". |
|
| 41 | + "You can display this information again by running `php artisan deploy:info`\n"; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | $this->info($message); |