@@ 29-44 (lines=16) @@ | ||
26 | $environment = $dataTransfer->Environment(); |
|
27 | $backupDataTransfer = null; |
|
28 | ||
29 | if( |
|
30 | !empty($this->args['backupBeforePush']) |
|
31 | && $this->args['backupBeforePush'] !== 'false' |
|
32 | && $dataTransfer->Direction == 'push' |
|
33 | ) { |
|
34 | $backupDataTransfer = DNDataTransfer::create(); |
|
35 | $backupDataTransfer->EnvironmentID = $environment->ID; |
|
36 | $backupDataTransfer->Direction = 'get'; |
|
37 | $backupDataTransfer->Mode = $dataTransfer->Mode; |
|
38 | $backupDataTransfer->ResqueToken = $dataTransfer->ResqueToken; |
|
39 | $backupDataTransfer->AuthorID = $dataTransfer->AuthorID; |
|
40 | $backupDataTransfer->write(); |
|
41 | ||
42 | $dataTransfer->BackupDataTransferID = $backupDataTransfer->ID; |
|
43 | $dataTransfer->write(); |
|
44 | } |
|
45 | ||
46 | try { |
|
47 | // Disallow concurrent jobs (don't rely on queuing implementation to restrict this) |
@@ 95-110 (lines=16) @@ | ||
92 | // deploy onto a clean environment will not be performing any backup regardless of |
|
93 | // whether the predeploy_backup option was passed or not. |
|
94 | // Sometimes predeploy_backup comes through as string false from the frontend. |
|
95 | if( |
|
96 | !empty($this->args['predeploy_backup']) |
|
97 | && $this->args['predeploy_backup'] !== 'false' |
|
98 | && !empty($currentBuild) |
|
99 | ) { |
|
100 | $backupDataTransfer = DNDataTransfer::create(); |
|
101 | $backupDataTransfer->EnvironmentID = $environment->ID; |
|
102 | $backupDataTransfer->Direction = 'get'; |
|
103 | $backupDataTransfer->Mode = $backupMode; |
|
104 | $backupDataTransfer->ResqueToken = $deployment->ResqueToken; |
|
105 | $backupDataTransfer->AuthorID = $deployment->DeployerID; |
|
106 | $backupDataTransfer->write(); |
|
107 | ||
108 | $deployment->BackupDataTransferID = $backupDataTransfer->ID; |
|
109 | $deployment->write(); |
|
110 | } |
|
111 | ||
112 | try { |
|
113 | // Disallow concurrent deployments (don't rely on queuing implementation to restrict this) |