Skip to content

Commit

Permalink
Add --extra-dump option to archive:dump (#5915)
Browse files Browse the repository at this point in the history
* Add --extra-dump option to archive:dump

* Update ArchiveDumpCommands.php

* Update ArchiveDumpCommands.php to ue options similar to sql:sync
  • Loading branch information
liberatr authored and weitzman committed Mar 18, 2024
1 parent 955728d commit 48dc17e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Commands/core/ArchiveDumpCommands.php
Expand Up @@ -68,6 +68,7 @@ final class ArchiveDumpCommands extends DrushCommands
#[CLI\Option(name: 'overwrite', description: 'Overwrite destination file if exists.')]
#[CLI\Option(name: 'code', description: 'Archive codebase.')]
#[CLI\Option(name: 'exclude-code-paths', description: 'Comma-separated list of paths (or regular expressions matching paths) to exclude from the code archive.')]
#[CLI\Option(name: 'extra-dump', description: 'Add custom arguments/options to the dumping of the database (e.g. <info>mysqldump</info> command).')]
#[CLI\Option(name: 'files', description: 'Archive Drupal files.')]
#[CLI\Option(name: 'db', description: 'Archive database SQL dump.')]
#[CLI\Option(name: 'description', description: 'Describe the archive contents.')]
Expand All @@ -79,6 +80,7 @@ final class ArchiveDumpCommands extends DrushCommands
#[CLI\Usage(name: 'drush archive:dump --destination=/path/to/archive.tar.gz --overwrite', description: 'Create (or overwrite if exists) /path/to/archive.tar.gz file containing code, database and Drupal files.')]
#[CLI\Usage(name: 'drush archive:dump --code --destination=/path/to/archive.tar.gz', description: 'Create /path/to/archive.tar.gz file containing the code only.')]
#[CLI\Usage(name: 'drush archive:dump --exclude-code-paths=foo_bar.txt,web/sites/.+/settings.php --destination=/path/to/archive.tar.gz', description: 'Create /path/to/archive.tar.gz file containing code, database and Drupal files but excluding foo_bar.txt file and settings.php files if found in web/sites/* subdirectories.')]
#[CLI\Usage(name: 'drush archive:dump --extra-dump=--no-data --destination=/path/to/archive.tar.gz', description: 'Create /path/to/archive.tar.gz file and pass extra option to <info>mysqldump</info> command.')]
#[CLI\Usage(name: 'drush archive:dump --files --destination=/path/to/archive.tar.gz', description: 'Create /path/to/archive.tar.gz file containing the Drupal files only.')]
#[CLI\Usage(name: 'drush archive:dump --database --destination=/path/to/archive.tar.gz', description: 'Create /path/to/archive.tar.gz archive file containing the database dump only.')]
#[CLI\OptionsetTableSelection]
Expand All @@ -95,6 +97,7 @@ public function dump(array $options = [
'generator' => InputOption::VALUE_REQUIRED,
'generatorversion' => InputOption::VALUE_REQUIRED,
'exclude-code-paths' => InputOption::VALUE_REQUIRED,
'extra-dump' => self::REQ,
]): string
{
$this->prepareArchiveDir();
Expand Down

0 comments on commit 48dc17e

Please sign in to comment.