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

Autogenerate sites.php if one doesn't exist #13

Open
jeffgeorge opened this issue Jan 27, 2016 · 0 comments
Open

Autogenerate sites.php if one doesn't exist #13

jeffgeorge opened this issue Jan 27, 2016 · 0 comments

Comments

@jeffgeorge
Copy link
Member

There's a slight dispute over if sites.php should be part of your repo or not.

In some cases (like a profile-based site built by Drush Make) there by definition won't be a sites.php.

Helpfully, we should be able to generate one with an erb template.

If a site's config.rb block has a multisite_dir variable set, we should check to see if /srv/www/${path}/sites/sites.php exists. If it does, we should see if there's a line in the format:

$sites['${host}'] = '${multisite_dir}';

If not, we should add one.

If no file exists, we should create a template sites.php that just starts with an open php block <?php and has that first multisite def as the first line.

This will probably be pretty difficult, as Puppet doesn't like partially modifying a file. Puppet likes managing a file outright. So if you try to modify a file twice I fully expect it would get angry . . . but then you'd need to sort out what hosts belong to what shared checkout directories, and that's not readily available due to the structure of config.rb. Maybe we need to an extra collect-to-fact like we do for hostnames?

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

No branches or pull requests

1 participant