|
@@ -283,26 +283,6 @@ class SiteController {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static function migrate($data): void {
|
|
|
|
|
- $username = $data['username'] ?? '';
|
|
|
|
|
- $domain = $data['domain'] ?? '';
|
|
|
|
|
- $adminName = $data['admin_name'] ?? '';
|
|
|
|
|
- $adminPassword = $data['admin_password'] ?? '';
|
|
|
|
|
- if (empty($username) || empty($domain) || empty($adminName) || empty($adminPassword)) {
|
|
|
|
|
- http_response_code(400);
|
|
|
|
|
- echo json_encode(['error' => 'Missing required parameters']);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- // Deployment from dev to prod
|
|
|
|
|
- exec("sudo /usr/bin/cp -a /home/$username/dev.$domain/. /home/$username/$domain/",$cpOutput,$cpReturnCode);
|
|
|
|
|
- if ($cpReturnCode !== 0) {
|
|
|
|
|
- http_response_code(500);
|
|
|
|
|
- echo json_encode(['error' => 'Failed to copy dev installation into prod directory', 'details' => implode("\n", $cpOutput)]);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- echo json_encode(['success' => 'Production site successfully from dev']);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public static function undeploy($data): void {
|
|
public static function undeploy($data): void {
|
|
|
$username = $data['username'] ?? '';
|
|
$username = $data['username'] ?? '';
|
|
|
$domain = $data['domain'] ?? '';
|
|
$domain = $data['domain'] ?? '';
|