Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
8 changes: 8 additions & 0 deletions src/Robo/Plugin/Commands/GetDBCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ public function getDB(ConsoleIO $io, array $args) {
return 'Acquia CLI is not installed, please install and configure it: https://docs.acquia.com/acquia-cli/install/';
}
break;
case 'platform':
if ($this->getCliToolStatus('platform')) {
$cmd = "platform db:dump --gzip --file=$dbFolder/site-db.sql.gz -p $remoteSiteName -e $remoteEnv";
}
else {
return 'Platform CLI is not installed, please install and configure it: https://docs.platform.sh/administration/cli.html';
}
break;
case 'pantheon':
default:
if ($this->getCliToolStatus('terminus')) {
Expand Down
26 changes: 26 additions & 0 deletions src/Robo/Plugin/Commands/GetFilesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public function getFiles(ConsoleIO $io, $opts = ['no-download' => FALSE]) {
case 'acquia':
$tasks = $this->getFilesAcquia($io, $tasks, $remoteSiteName, $remoteEnv);
break;
case 'platform':
$tasks = $this->getFilesPlatform($io, $tasks, $remoteSiteName, $remoteEnv);
break;
case 'pantheon':
default:
$tasks = $this->getFilesPantheon($io, $opts, $tasks, $remoteSiteName, $remoteEnv, $origFilesFolder, $destFilesFolder);
Expand Down Expand Up @@ -78,6 +81,7 @@ private function getFilesAcquia(ConsoleIO $io, $tasks, $remoteSiteName, $remoteE
else {
return 'Your Local env doesnt have a valid acquia project structure, your drupal root should be the "docroot" folder.';
}

return $tasks;
}

Expand All @@ -103,4 +107,26 @@ private function getFilesPantheon(ConsoleIO $io, array $opts, $tasks, $remoteSit

return $tasks;
}

/**
* Helper function to get files from PlatformSH.
*/
private function getFilesPlatform(ConsoleIO $io, $tasks, $remoteSiteName, $remoteEnv) {
if (file_exists($this->getLocalEnvRoot() . '/web/sites/default/files')) {
if ($this->getCliToolStatus('acli')) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

acli belongs to acquia

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rigoucr this was fixed.

$io->say('Syncing files from the ' . $remoteEnv . ' environment...');
$cmd = "platform mount:download /mnt/files {$this->getLocalEnvRoot()}/web/sites/default/files -p $remoteSiteName -e $remoteEnv";
$tasks->addTask($this->taskExec($cmd));
}
else {
return 'Platform CLI is not installed, please install and configure it: https://docs.platform.sh/administration/cli.html';
}
}
else {
return 'Your Local env doesnt have a valid platform project structure, your drupal root should be the "web" folder.';
}

return $tasks;
}

}