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

Examples #5

Open
heddn opened this issue Sep 27, 2016 · 5 comments
Open

Examples #5

heddn opened this issue Sep 27, 2016 · 5 comments

Comments

@heddn
Copy link

heddn commented Sep 27, 2016

Here's my drushrc.php for a site. As a prerequisite, I've downloaded the drush script and put it in the same folder as the rc script.

include_once 'drush_cmi_tools.drush.inc';

$ignored_modules = implode(',', [
  'devel',
  'kint',
  'stage_file_proxy',
]);
$ignore_list = (dirname(__FILE__)) . '/config-ignore.yml';
$delete_list = (dirname(__FILE__)) . '/config-delete.yml';
$destination = (dirname(__FILE__)) . '/../config/sync';
$install_once = (dirname(__FILE__)) . '/../config/install_once';
$options['shell-aliases']['too-cexy'] = "cexy --skip-modules=$ignored_modules --destination=$destination --ignore-list=$ignore_list";
$options['shell-aliases']['too-cimy'] = "cimy --source=$destination --install=$install_once --delete-list=$delete_list";

Here's my example config-ignore.yml:

ignore:
ignore:
  - devel.settings
  - smtp.settings
  - stage_file_proxy.settings
  - system.menu.devel

config-delete.ym (empty for now):

delete: {}
@heddn
Copy link
Author

heddn commented Sep 27, 2016

Any suggestions on how to make this more slick? How can I depend on the drush script via composer and more importantly, move it into the right location?

@larowlan
Copy link
Member

To be honest, I wrap it all in a build tool. In this case, make so my Makefile defines all the parameters.

Then its just make import or make export.

Make is our personal preference having tried Robo and Phing.

Snippet from our Makefile

APP_ROOT=./app
CONFIG_DIR=$(CURDIR)/config-export
CONFIG_DELETE=$(CURDIR)/drush/config-delete.yml
CONFIG_IGNORE=$(CURDIR)/drush/config-ignore.yml
CONFIG_INSTALL=$(CURDIR)/config-install
CONFIG_SKIP_MODULES=devel

import:
    drush -r $(APP_ROOT) cimy -y --skip-modules=$(CONFIG_SKIP_MODULES) --source=$(CONFIG_DIR) --install=$(CONFIG_INSTALL) --delete-list=$(CONFIG_DELETE)

export:
    drush -r $(APP_ROOT) cexy -y --skip-modules=$(CONFIG_SKIP_MODULES) --destination=$(CONFIG_DIR) --ignore-list=$(CONFIG_IGNORE)

@heddn
Copy link
Author

heddn commented Sep 27, 2016

Interesting. Any chance on getting cimy/cexy into drush core?

@larowlan
Copy link
Member

Yep, moshe had indicated he'd support those flags in drush core, just need someone to write a PR

@heddn
Copy link
Author

heddn commented Sep 27, 2016

Another use case I just found for cimy/cexy is to ignore secured configuration i.e. the uid/pwd for my smtp server. This let's me put in an empty password string into the one time install folder, then I can manually configure/override it. No password in git!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants