Closed panosru closed 3 years ago
If I var_dump
the $process
variable here https://github.com/andres-montanez/Magallanes/blob/e30de6b719c923d70917a9f9364efdb29b7e9362/src/Task/BuiltIn/Deploy/Release/CleanupTask.php#L42
I receive:
/root/.composer/vendor/andres-montanez/magallanes/src/Task/BuiltIn/Deploy/Release/CleanupTask.php:43:
class Symfony\Component\Process\Process#72 (25) {
private $callback =>
NULL
private $hasCallback =>
bool(false)
private $commandline =>
string(141) "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@droplet-tecfinity "ls -1 /root/projects/fault-manager/releases""
private $cwd =>
string(24) "/root/test/fault-manager"
private $env =>
NULL
private $input =>
NULL
private $starttime =>
double(1549405586.8632)
private $lastOutputTime =>
double(1549405586.8632)
private $timeout =>
double(120)
private $idleTimeout =>
NULL
private $exitcode =>
int(255)
private $fallbackStatus =>
array(0) {
}
private $processInformation =>
array(8) {
'command' =>
string(141) "ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@droplet-tecfinity "ls -1 /root/projects/fault-manager/releases""
'pid' =>
int(1258)
'running' =>
bool(false)
'signaled' =>
bool(false)
'stopped' =>
bool(false)
'exitcode' =>
int(255)
'termsig' =>
int(0)
'stopsig' =>
int(0)
}
private $outputDisabled =>
bool(false)
private $stdout =>
resource(204) of type (stream)
private $stderr =>
resource(206) of type (stream)
private $process =>
resource(211) of type (Unknown)
private $status =>
string(10) "terminated"
private $incrementalOutputOffset =>
int(0)
private $incrementalErrorOutputOffset =>
int(0)
private $tty =>
NULL
private $pty =>
bool(false)
private $useFileHandles =>
bool(false)
private $processPipes =>
class Symfony\Component\Process\Pipes\UnixPipes#74 (8) {
private $ttyMode =>
NULL
private $ptyMode =>
bool(false)
private $haveReadSupport =>
bool(true)
public $pipes =>
array(0) {
}
private $inputBuffer =>
string(0) ""
private $input =>
NULL
private $blocked =>
bool(false)
private $lastError =>
NULL
}
private $latestSignal =>
NULL
}
$process->isSuccessful();
returns false
but if I run the command manually, it works fine:
Still relevant on version 5
[2022-06-13T22:23:11.522611+00:00] magephp.INFO: ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /var/www/html/deploy_key/key test@test.com "cd /var/www && ln -snf releases/20220613222242 laravel" [] []
[2022-06-13T22:23:12.643536+00:00] magephp.DEBUG: [] []
[2022-06-13T22:23:12.644664+00:00] magephp.DEBUG: Task [Release] Creating Symlink (deploy/release) finished with OK [] []
[2022-06-13T22:23:12.645473+00:00] magephp.DEBUG: Running task [Exec] Rm env (exec) [] []
[2022-06-13T22:23:12.646186+00:00] magephp.INFO: ssh -p 22 -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /var/www/html/deploy_key/key test@test.com "cd /var/www/releases/20220613222242 && rm .env && mv .env.prod .env" [] []
[2022-06-13T22:23:12.726123+00:00] magephp.DEBUG: [] []
[2022-06-13T22:23:12.726598+00:00] magephp.ERROR: [] []
[2022-06-13T22:23:12.727400+00:00] magephp.DEBUG: Task [Exec] Rm env (exec) finished with FAIL [] []
It looks like problem is with Rate limiting with UFW not with php code itself.
I'm testing mage, it seems cool, but it does not remove old releases:
.mage.yml:
The log result:
Also, shouldn't it rename the file
Fault.php
toFault2.php
?Thanks!