-
Notifications
You must be signed in to change notification settings - Fork 2
Command deploy:export-remote-config #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rigoucr
wants to merge
1
commit into
3.x
Choose a base branch
from
feature/deploy-export-live-config
base: 3.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| <?php | ||
|
|
||
| namespace Fire\Robo\Plugin\Commands; | ||
|
|
||
| use Robo\Robo; | ||
| use Robo\Symfony\ConsoleIO; | ||
| use Fire\Robo\Plugin\Commands\FireCommandBase; | ||
|
|
||
| /** | ||
| * Provides as Command that Exports the config from the Selected remote env. | ||
| */ | ||
| class DeployExportConfigCommand extends FireCommandBase { | ||
|
|
||
| /** | ||
| * Exports the config from the selected remote enviroment. | ||
| * | ||
| * Usage Example: fire deploy:export-remote-config | ||
| * | ||
| * @command deploy:export-remote-config | ||
| * @aliases dex | ||
| * | ||
| */ | ||
| public function exportRemoteConfig(ConsoleIO $io) { | ||
| $remotePlatform = Robo::config()->get('remote_platform'); | ||
| $remoteSiteName = Robo::config()->get('remote_sitename'); | ||
| $defaultCanonicalEnv = Robo::config()->get('remote_canonical_env'); | ||
|
|
||
| $tasks = $this->collectionBuilder($io); | ||
| $confirmation = $io->confirm('You are about to get the lastest Database from a ' . $remotePlatform . ' envoriment and override your local env with, Do you want to continue?'); | ||
| if ($confirmation) { | ||
| $remoteEnv = $io->ask("From which enviroment would like to donwload the Database Copy?", $defaultCanonicalEnv); | ||
| if ($remotePlatform == 'pantheon') { | ||
| $tasks->addTask($this->taskExec('terminus backup:create ' . $remoteSiteName . '.' . $remoteEnv . ' --element=db')); | ||
| } | ||
| if ($remotePlatform == 'acquia') { | ||
| // @todo get the right database name ask to user or configure from fire.yml. | ||
| // Or automatically get it from acquia ? | ||
| $acquiaDb = 'my_db'; | ||
| //acli api:environments:database-backup-create <environmentId> <databaseName> | ||
| // https://docs.acquia.com/acquia-cloud-platform/add-ons/acquia-cli/commands/api:environments:database-backup-create | ||
| $tasks->addTask($this->task->taskExec('acli api:environments:database-backup-create ' . $remoteSiteName . '.' . $remoteEnv . ' ' . $acquiaDb)); | ||
| } | ||
| $tasks->addTask($this->taskExec('fire local:get-db')); | ||
| $tasks->addTask($this->taskExec('fire local:import-db')); | ||
| $tasks->addTask($this->taskExec('fire drush updb -- -y')); | ||
| $tasks->addTask($this->taskExec('fire drush cr -- -y')); | ||
| $tasks->addTask($this->taskExec('fire drush cex -- -y')); | ||
| } | ||
| return $tasks; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running
drush updbis not necessary here. If you are exporting configuration, you are likely trying to get configuration into the master branch. I suspect that you need to remove both drush updb and drush cr. If the plan is to "upgrade" the configuration usin gthe latest code, this this also doesn't do a great job because what ever branch you are on is going to have it's configuration blown away.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out https://www.notion.so/fourkitchens/ENG-Guide-General-Steps-for-Deploying-a-Drupal-8-Website-to-Production-503ff0cb7ab24de19534e0dcd3cf57d0?pvs=4#eff1cc2ada694ed7a8d872eec2e84e42