Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions ps_silverstripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,30 @@
writeln('Finshed - go test website - if there are issues, rollback using dep sitehost:upgrade-mysql:rollback to swap .env files back');
});



/**
* Sitehost - Open SSH shell to remote server
* https://stackoverflow.com/questions/77532896/starting-remote-ssh-session-from-deployer-inside-docker
*/
task('sitehost:remoteshell', function () {
$host = currentHost();

$hostname = $host->getHostname();
$remoteUser = $host->get('remote_user');

if (!$remoteUser) {
throw new \RuntimeException("Remote user not set for host.");
}

// $sshCommand = "ssh -T $remoteUser@$hostname";
$sshCommand = "script -q -c \"ssh $remoteUser@$hostname\" /dev/null";

runLocally($sshCommand, ['tty' => true]);
});



/**
* Sitehost - Roll back to old .env
*/
Expand Down Expand Up @@ -243,6 +267,9 @@
run('{{bin/php}} {{release_path}}/{{silverstripe_cli_script}} /dev/build flush=all');
})->desc('Run /dev/build?flush=all');




/**
* If deploy to production, then ask to be sure
*/
Expand Down