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

Add docs and recipe for git submodules #9

Open
jason-murray opened this issue Jun 10, 2017 · 3 comments
Open

Add docs and recipe for git submodules #9

jason-murray opened this issue Jun 10, 2017 · 3 comments

Comments

@jason-murray
Copy link
Contributor

Using git submodules for plugins and themes not on the wordpress.org repo is a great workflow for us and solves the issue of things not being on the .org repo quite nicely.

However there aren't any docs for this just now really, barring something in the TODO.md.

Also the deployer recipe can probably be adjusted a bit as the submodules are not in the .gitignore so are not symlinked as shared:

@jason-murray
Copy link
Contributor Author

Hmm, learned the hard way here that git submodule (and git in general) won't follow symlinks.

Came up with this in regolith-recipe.php to get the list of submodules, but after they are symlinked deployer errors out during install-dependencies.sh

	$submodules = explode(PHP_EOL, `git submodule`);
	$submodule_dependencies = array ();

	foreach ($submodules as $str) {
		if ( preg_match( '#(web\/content\/.*) #', $str, $m ) ) {
			$submodule_dependencies[] = $m[1];
		}
	}
...
	$shared_directories = array_merge( $other_shared, $plugin_dependencies, $theme_dependencies, $submodule_dependencies );

@jason-murray
Copy link
Contributor Author

I think we could add the submodules to the copy_dirs option in Deployer, to copy them between releases and save them being redownloaded every deploy.

@iandunn
Copy link
Owner

iandunn commented Aug 26, 2017

Hmm, I think when I got it working on one of my sites, I just let it download a fresh copy with each deploy. That's definitely slower, but the simplicity might make it worth the tradeoff.

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