Skip to content
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

Make sync:db non interactive on Travis. #1841

Closed
ericchenshine opened this issue Jul 27, 2017 · 3 comments
Closed

Make sync:db non interactive on Travis. #1841

ericchenshine opened this issue Jul 27, 2017 · 3 comments
Labels
Bug Something isn't working

Comments

@ericchenshine
Copy link

My system information:

  • Operating system type: Ubuntu (in Travis-ci)
  • Operating system version: 14.4
  • BLT version: 8.9.0

We have overridden setup command to do sync:db from remote instead of setup:drupal:install which builds a vanilla Drupal site.

The the script is running in the Travis we saw code is hanging after running sync:db with the question - "Do you really want to drop all tables in the database drupal? (y/n)".

I have checked the code of sync:db as below

  public function syncDbDefault() {
    $this->invokeCommand('setup:settings');

    $local_alias = '@' . $this->getConfigValue('drush.aliases.local');
    $remote_alias = '@' . $this->getConfigValue('drush.aliases.remote');

    $task = $this->taskDrush()
      ->alias('')
      ->assume('')
      ->drush('cache-clear drush')
      ->drush('sql-drop')
      ->drush('sql-sync')
      ->arg($remote_alias)
      ->arg($local_alias)
      ->option('structure-tables-key', 'lightweight')
      ->option('create-db');

    if ($this->getConfigValue('drush.sanitize')) {
      $task->option('sanitize');
    }

    $task->drush('cache-clear drush');

    $result = $task->run();

    return $result;
  }

We are wondering if we could change code to

    $task = $this->taskDrush()
      ->drush('cache-clear drush')
      ->drush('sql-drop')
      ->drush('sql-sync')
      ->arg($remote_alias)
      ->arg($local_alias)
      ->option('structure-tables-key', 'lightweight')
      ->option('create-db')
      ->assume(TRUE)
      ->printOutput(TRUE);
@grasmash grasmash added the Bug Something isn't working label Jul 31, 2017
@grasmash
Copy link
Contributor

Related to #1852.

@grasmash grasmash changed the title Make sync:db non interactive Make sync:db non interactive on Travis. Jul 31, 2017
@alex-moreno
Copy link
Contributor

same issue here,

->assume(TRUE)

seems to fix it

@grasmash
Copy link
Contributor

Closed by #1859

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants