Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Make the cm.core.config-dir property configurable #1013

Closed
bkosborne opened this issue Jan 25, 2017 · 7 comments
Closed

Make the cm.core.config-dir property configurable #1013

bkosborne opened this issue Jan 25, 2017 · 7 comments
Labels
Enhancement A feature or feature request

Comments

@bkosborne
Copy link
Contributor

Ok, so I thought I could deal with this, but every time I'm prompted for a config directory when I do a config import or export I die a little inside :)

Here's the main issue where I brought this up: #678

Basically, Drupal wants there to be a config directory labeled 'sync' (it complains if it doesn't exist), but BLT wants there to be one labeled 'vcs'.

My site only uses one actual config directory. As a result I have this snippet at the very bottom of my site's settings.php file:

$config_dir = dirname(DRUPAL_ROOT) . "/config/$site_dir";
$config_directories['sync'] = $config_dir;
$config_directories['vcs'] = $config_dir;

That way they are both defined and BLT and Drupal are happy.

But because of that, whenever I do a config export or config import, I'm prompted to chose one of those, even though they are the same.

What I suggest doing here is changing this line so that it accepts a parameter instead of hardcoding "vcs". Then I could configure it on my project.yml file.

@bkosborne
Copy link
Contributor Author

OK, so after further inspection, Acquia Cloud's settings.php file, which BLT includes, includes, actually does set both 'vcs' and 'sync' directories:

$config_directories['sync'] = $app_root . '/' . $site_path . '/files/config_123ABC/sync';
if (!drupal_installation_attempted()) {
  $config_directories['vcs'] = $app_root . '/../config/' . basename($site_path);
  ...
}

How frustrating.

So I would have to unset it's definition in my settings.php overrides, which execute after the inclusion of Acquia's files:

$config_dir = dirname(DRUPAL_ROOT) . "/config/$site_dir";
$config_directories['sync'] = $config_dir;
// Unset config directory that Acquia defines. We just use the main 'sync' directory above.
unset($config_directories['sync']);

So still, I need to be able to tell BLT to not try and import configuration from the 'vcs' config directory.

@grasmash
Copy link
Contributor

@bkosborne The simplest solution for you may be to disable the setup:config-import task, or replace it with your own custom task.

@grasmash grasmash added the Enhancement A feature or feature request label Jan 27, 2017
@bkosborne
Copy link
Contributor Author

Interestingly enough, it looks like there is a already a default variable defined for "cm.core.config-dir" here: https://github.com/acquia/blt/blob/8.x/phing/build.yml#L39

But the value of the var is not being used.

@bkosborne
Copy link
Contributor Author

Ok, created a PR just to remove the override of the config sync directory in the deploy task. There's already a var defined for that directory, the deploy task was overriding it to use "vcs" instead.

Would def need a change log notice if accepted.

In the mean time, for my project, I just overwrote the deploy:update target and removed the property override entirely.

grasmash added a commit to grasmash/bolt that referenced this issue Feb 13, 2017
…uration directory and partial flag to be configurable.
grasmash added a commit that referenced this issue Feb 13, 2017
@bkosborne
Copy link
Contributor Author

For future reference, I think I now understand why Acquia has two config directories, "vcs" and the default "sync" one that Drupal needs.

If you take the approach I take and just use the ../config/default/ as the only config directory, and set Drupal's "sync" config directory to this path, then you will not be able to export active config in Drupal's UI because ../config/default is not writeable by the web server.

I'm OK with that, since I can use drush to export the active config and specify the --destination parameter to specify a writeable directory elsewhere on the server, then copy the files down.

@grasmash
Copy link
Contributor

cm.core.config-dir is now configurable as of #1080

@bkosborne
Copy link
Contributor Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement A feature or feature request
Projects
None yet
Development

No branches or pull requests

2 participants