@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | return false; |
| 46 | 46 | } |
| 47 | 47 | case 'Queued': |
| 48 | - if ($this->Pipeline()->SkipSnapshot) { |
|
| 48 | + if($this->Pipeline()->SkipSnapshot) { |
|
| 49 | 49 | return $this->startDeploy(); |
| 50 | 50 | } else { |
| 51 | 51 | return $this->createSnapshot(); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | // Skip deployment for dry run |
| 86 | 86 | if($this->Pipeline()->DryRun) { |
| 87 | - $this->log("[Skipped] Create DNDeployment for SHA ".$pipeline->SHA); |
|
| 87 | + $this->log("[Skipped] Create DNDeployment for SHA " . $pipeline->SHA); |
|
| 88 | 88 | $this->write(); |
| 89 | 89 | return true; |
| 90 | 90 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | // check if we have timed out |
| 41 | - if ($this->isTimedOut()) { |
|
| 41 | + if($this->isTimedOut()) { |
|
| 42 | 42 | $this->log(sprintf(_t('EmergencyRollbackStep.ROLLBACKTIMEOUT', |
| 43 | 43 | "{$this->Title} is older than %s seconds and has timed out"), |
| 44 | 44 | $this->MaxDuration)); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | ); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - if ($this->Status == 'Queued') { |
|
| 88 | + if($this->Status == 'Queued') { |
|
| 89 | 89 | $this->start(); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $this->write(); |
| 97 | 97 | |
| 98 | 98 | // Rollback itself is handled by the Pipeline object. This step will be marked as failed. |
| 99 | - if ($this->Pipeline()->isRunning()) { |
|
| 99 | + if($this->Pipeline()->isRunning()) { |
|
| 100 | 100 | $this->Pipeline()->markFailed(); |
| 101 | 101 | return true; |
| 102 | 102 | } else { |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function beginRollbackWindow() { |
| 129 | 129 | $this->Status = 'Started'; |
| 130 | - if (!$this->Started) $this->Started = SS_Datetime::now()->Rfc2822(); |
|
| 130 | + if(!$this->Started) $this->Started = SS_Datetime::now()->Rfc2822(); |
|
| 131 | 131 | $this->log(_t('EmergencyRollbackStep.BEGINROLLBACKWINDOW', |
| 132 | 132 | "{$this->Title} is beginning a rollback window...")); |
| 133 | 133 | $this->write(); |
@@ -251,7 +251,7 @@ |
||
| 251 | 251 | */ |
| 252 | 252 | public function abort() { |
| 253 | 253 | |
| 254 | - if ($this->isQueued() || $this->isRunning()) { |
|
| 254 | + if($this->isQueued() || $this->isRunning()) { |
|
| 255 | 255 | $this->Status = 'Aborted'; |
| 256 | 256 | $this->log('Step aborted'); |
| 257 | 257 | $this->write(); |
@@ -219,7 +219,7 @@ |
||
| 219 | 219 | * @return boolean |
| 220 | 220 | */ |
| 221 | 221 | protected function doRestoreDB() { |
| 222 | - if ($this->Pipeline()->SkipSnapshot) return false; |
|
| 222 | + if($this->Pipeline()->SkipSnapshot) return false; |
|
| 223 | 223 | |
| 224 | 224 | return $this->getConfigSetting('RestoreDB') && $this->Pipeline()->PreviousSnapshot(); |
| 225 | 225 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | curl_setopt($ch, CURLOPT_URL, $test['URL']); |
| 126 | 126 | |
| 127 | 127 | // Allow individual tests to override number of attempts |
| 128 | - $attempts = (int) $this->getConfigSetting('Attempts'); |
|
| 128 | + $attempts = (int)$this->getConfigSetting('Attempts'); |
|
| 129 | 129 | if(!empty($test['Attempts'])) $attempts = $test['Attempts']; |
| 130 | 130 | |
| 131 | 131 | // Run through each attempt |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | // Check response |
| 149 | - $info = curl_getinfo($ch); |
|
| 149 | + $info = curl_getinfo($ch); |
|
| 150 | 150 | |
| 151 | 151 | // if an expected response time is specified, check that against the results |
| 152 | 152 | if(isset($test['ExpectResponse'])) { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | // check if we have timed out |
| 42 | - if ($this->isTimedOut()) { |
|
| 42 | + if($this->isTimedOut()) { |
|
| 43 | 43 | $this->log(sprintf(_t('TriggerDeployStep.DEPLOYTIMEOUT', |
| 44 | 44 | 'Deployment step is older then %s seconds and has timed out'), |
| 45 | 45 | $this->MaxDuration)); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | ); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - if ($this->Status == 'Queued') { |
|
| 89 | + if($this->Status == 'Queued') { |
|
| 90 | 90 | $this->start(); |
| 91 | 91 | } |
| 92 | 92 | // Trigger deployment |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function StartDeployment() { |
| 105 | 105 | $this->Status = 'Started'; |
| 106 | - if (!$this->Started) $this->Started = SS_Datetime::now()->Rfc2822(); |
|
| 106 | + if(!$this->Started) $this->Started = SS_Datetime::now()->Rfc2822(); |
|
| 107 | 107 | $this->log("Starting {$this->Title}..."); |
| 108 | 108 | $this->write(); |
| 109 | 109 | return true; |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | foreach($environments as $environment) { |
| 15 | 15 | $newFilename = basename($environment->Filename); |
| 16 | 16 | if($environment->Filename != $newFilename) { |
| 17 | - echo 'Migrating "'.$environment->Filename.'" to '.$newFilename.PHP_EOL; |
|
| 17 | + echo 'Migrating "' . $environment->Filename . '" to ' . $newFilename . PHP_EOL; |
|
| 18 | 18 | $environment->Filename = $newFilename; |
| 19 | 19 | $environment->write(); |
| 20 | 20 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | foreach($projects as $project) { |
| 27 | 27 | if(!$project->projectFolderExists()) { |
| 28 | 28 | $warnings = true; |
| 29 | - echo 'Project '.$project->Name.' don\'t have a cap project folder'.PHP_EOL; |
|
| 29 | + echo 'Project ' . $project->Name . ' don\'t have a cap project folder' . PHP_EOL; |
|
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | if($warnings) { |
@@ -8,18 +8,18 @@ discard block |
||
| 8 | 8 | $dryRun = true; |
| 9 | 9 | |
| 10 | 10 | if($request && $request->requestVar('remove') !== NULL) { |
| 11 | - $remove = (bool) $request->requestVar('remove'); |
|
| 11 | + $remove = (bool)$request->requestVar('remove'); |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | if($request && $request->requestVar('dryrun') !== NULL) { |
| 15 | - $dryRun = (bool) $request->requestVar('dryrun'); |
|
| 15 | + $dryRun = (bool)$request->requestVar('dryrun'); |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | if($dryRun) { |
| 19 | 19 | echo "Running in dry run mode, no changes commited, "; |
| 20 | - echo "the output shows a prediction on what will happen.".PHP_EOL; |
|
| 21 | - echo "To skip dryrun, run the task like this:".PHP_EOL; |
|
| 22 | - echo "./framework/sake dev/tasks/SyncProjectsAndEnvironments dryrun=0".PHP_EOL.PHP_EOL; |
|
| 20 | + echo "the output shows a prediction on what will happen." . PHP_EOL; |
|
| 21 | + echo "To skip dryrun, run the task like this:" . PHP_EOL; |
|
| 22 | + echo "./framework/sake dev/tasks/SyncProjectsAndEnvironments dryrun=0" . PHP_EOL . PHP_EOL; |
|
| 23 | 23 | sleep(3); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | foreach($removeList as $remove) { |
| 67 | - $this->message('Removing "'.basename($remove->Name).'" from db'); |
|
| 67 | + $this->message('Removing "' . basename($remove->Name) . '" from db'); |
|
| 68 | 68 | if(!$dryRun) { |
| 69 | 69 | $removeList->remove($remove); |
| 70 | 70 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | foreach($removeList as $remove) { |
| 87 | - $this->message($remove->Name.' '.$remove->Path); |
|
| 87 | + $this->message($remove->Name . ' ' . $remove->Path); |
|
| 88 | 88 | if(!$dryrun) { |
| 89 | 89 | $removeList->remove($remove); |
| 90 | 90 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | continue; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - $this->message('Adding "'.basename($path).'" to db'); |
|
| 118 | + $this->message('Adding "' . basename($path) . '" to db'); |
|
| 119 | 119 | if(!$dryRun) { |
| 120 | 120 | $environment = DNEnvironment::create_from_path($path); |
| 121 | 121 | $environment->ProjectID = $project->ID; |
@@ -146,9 +146,9 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | protected function message($text) { |
| 148 | 148 | if(PHP_SAPI !== 'cli') { |
| 149 | - $text = '<p>'.$text.'</p>'.PHP_EOL; |
|
| 149 | + $text = '<p>' . $text . '</p>' . PHP_EOL; |
|
| 150 | 150 | } |
| 151 | - echo ' - '.$text.PHP_EOL; |
|
| 151 | + echo ' - ' . $text . PHP_EOL; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -157,9 +157,9 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | protected function echoHeader($text) { |
| 159 | 159 | if(PHP_SAPI !== 'cli') { |
| 160 | - echo '<h2>'.$text.'</h2>'.PHP_EOL; |
|
| 160 | + echo '<h2>' . $text . '</h2>' . PHP_EOL; |
|
| 161 | 161 | } else { |
| 162 | - echo '# '.$text.PHP_EOL; |
|
| 162 | + echo '# ' . $text . PHP_EOL; |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | } |