First a big thanks for the work on the Drupal 8 version of Basic. It's already been a huge help in getting our workflow updated to Drupal 8.

I have a question however, about configuration sync using the drush config-export and drush config-import

I'm planning on using this method to sync development with staging and production (we've configured a directory for this outside of web root).

According to drush docs ...
http://www.drush.org/en/master/config-exporting/#ignoring-development-mo...
as well as here....
https://pantheon.io/blog/using-configuration-module-filter-drush-8

... it's possible to exclude certain modules from the export/import process.

However, when I run a drush config-export - Basic's theme settings - basic.settings.yml (including options for browser_sync etc.), are included in the export.

I've also been reading about the Configuration override system - https://www.drupal.org/node/1928898, and if I've understood this correctly, it's possible to supply default overrides for module and theme settings (although I confess I've not tried this yet).

Another alternative would be to include these settings.yml files in .gitignore, but this seems a little clunky.

Lastly, I'm curious to know how you created the default block configuration files in basic/config/install? Did these come from a drush config-export, and then had their uuids and hashes removed?

Thoughts or suggestions greatly appreciated.

Comments

blue_waters created an issue. See original summary.

anthony.bouch’s picture

Issue summary: View changes
anthony.bouch’s picture

leahtard’s picture

Hi blue_waters!

As I have been managing the import/export of config on D8 projects, I have been adding files I don't want synced to my .gitignore. It has been working for me but I am not married to that technique if there is a better option.

About the default block configuration, this is handled by the files in the "config/install" folder. If you look at a few of the block yml files there, you will see how we are defining the regions they should be added to. This is only called on install. If you move blocks around afterward, they should stay where you put them. Let me know if you are seeing something different.

As you continue to dive into this, I would love to hear more about you find. If we can make any changes at theme level, that could make this easier, please let us know!

Cheers, Leah

anthony.bouch’s picture

Thank Leah - much appreciated. I was aware that the yaml config files are loaded from config/install on first install - I was just curious to know how you initially created these. From a config-export? And then pulled out the block yaml files, and removed the guids? No worries either way.

I'm also wondering if there might be another way to keep 'local' theme settings 'local' - in particular the browsersync option. For example, the dev setup for a Drupal 8 install typically involves sourcing 'settings.local.php' and 'development.services.yml' - to turn on Twig debugging, disable page caching etc. without having to change config - which means you can easily deploy to production. We use Capistrano to deploy and "Drush config-export" is on of the tasks we run before our final commit, push and deploy (this is a little out of date now - but basically this approach https://www.58bits.com/blog/2013/03/23/deploying-drupal-with-capistrano).

I tried for a minute or so to see if there was a way to override and set [theme].settings.broweserync=true in settings.local.php - but have a hunch this might be too early in the bootstrap process. Not sure.

Thanks again for the replies and the great dev starter theme.

Best,

Tony

leahtard’s picture

Hey blue_waters,

I don't think any fancy CMI export was involved when creating the config/install files. I believe the YML files were just created -- @joelpittet actually took care of this.

Right now I am just git-ignoring my theme settings config file. Yes, it would be nice if we could be selective here. If you make additional progress, let us know.

Cheers, Leah

mark.labrecque’s picture

I came across an interesting blog post that might be applicable here: https://www.chapterthree.com/blog/overriding-drupal-8-configuration-valu... - Could this possibly solve the issue? It depends how many settings you want to override, because most developers like to keep their settings.php pretty lean. Alternatively, I wouldn't see an issue with creating a module to handle general config overrides like this. Hopefully this is interesting, even if doesn't fit your actual use case :)

leahtard’s picture

Status: Active » Fixed

Yes, Mark! This is also similar to what @gapple covered at the most recent VanDug meetup. I gave this a test this afternoon. If you add the following to settings.php (or settings.local.php if you have that enabled), this will enable BrowserSync - but CMI would not be aware of that setting.

$config['basic.settings']['browser_sync']['enabled'] = 'true';

Another thing to be aware of is that when you look at the Basic settings page, BrowserSync will not be checked.

A nice trick from the Chapter Three post is the drush command that lets you get the available settings. After running "drush cget basic.settings" it was easy to see how this line would had to be formatted.

Hope that helps blue_waters.

Cheers, Leah

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.