0

I know the export and import option is available but I have 5 environments, So each and every time after implementing new things on dev env I don't want to do export and import on other envs instead using pipeline I will execute the drush commands to implement the required changes on other envs by executing required Drush commands.

Reddy Rohit
  • 25
  • 1
  • 4

3 Answers3

0

The problem is that on Drupal the config import/export is the best way to do that. The config export doesn't not only export content type configuration, but the entire website configuration.

So thoses commands help you be iso between environments.

If your probleme is about ouverriding some config values between environments, the module Config Split can help you on it.

Sharklalu
  • 339
  • 1
  • 8
  • Hi Sharklalu, I'm trying the build one more Env from scratch with all the features and data present in the Dev Env Is this possible by using config split? – Reddy Rohit Jan 03 '22 at 17:17
  • The config splid module does'nt not export or import data values. Lets see https://www.drupal.org/project/content_synchronizer module or use a database dump + files folder – Sharklalu Jan 20 '22 at 11:08
0

With no config import, I would solve it with installing a module of your own, which runs your special code.

Steps:

  • Create a module my_custom_contenttype
  • Make a hook_install() (my_custom_contenttype_install())
  • Run this drush command (uninstall before, if you want to install it again - do it more than one time):
drush pm:uninstall my_custom_contenttype; drush pm:enable my_custom_contenttype;
function my_custom_contenttype_install(){
// Add content type if it not exist
};
Thomas
  • 76
  • 8
0

You could do this using manually-managed configuration. Either by:

  1. Creating a custom module and including your configurations in custom_module/config/install, and using "drush en" to install the module OR
  2. By using an existing custom module and using a post_update hook to install the configuration.

We do this on a number of sites, and loading and installing the configurations is just complex enough that we built a helper module to do it. You can pull this module in with composer and use update hooks to activate it, or you can look at the installConfig function here and use it a as a template. (the module has a helpful readme, too).