I've been looking into different ways of deploying sites using git, and found the following tutorial:
http://42pixels.com/blog/quick-and-dirty-git-deployment
I like the ideas presented in this tutorial, and would be keen on using it for my sites, only it doesn't seem to support submodules.
Is there anyway that this can be changed so that submodules are also pulled in and updated as required?
Thank you.
UPDATE
I've been working on this problem for the last couple of hours, and I seem to be making progress, but I still can't get it working.
I've switched to this tutorial: http://toroid.org/ams/git-website-howto (which is mostly the same, just a few slight changes), and after following some advice found here: https://stackoverflow.com/a/6636509/1049688 I've ended up with a post-receive file that looks like this:
#!/bin/sh
export GIT_WORK_TREE=/srv/www/limeblast.co.uk/htdocs_test
export GIT_DIR=/srv/www/limeblast.co.uk/.git
cd $GIT_WORK_TREE
git checkout -f master
git submodule init
git submodule update
This all seems fine in theory, and it would appear that the submodule commands are running, but I'm getting the following error messages back:
remote: Submodule 'wordpress' (git://github.com/WordPress/WordPress.git) registered for path 'wordpress' remote: Submodule 'wp-content/themes/limeblastevolution/inc/cssCrush' (git://github.com/peteboere/css-crush.git) registered for path 'wp-content/themes/limeblastevolution/inc/cssCrush' remote: fatal: working tree '/srv/www/limeblast.co.uk/htdocs_test' already exists. remote: Clone of 'git://github.com/WordPress/WordPress.git' into submodule path 'wordpress' failed
Any ideas? Thank you.
You might have success with git-deploy.
But if that is too much focused on Rails or if you cannot or will not use it for other reasons, here is how to force a submodule update in a post-commit hook:
git submodule init && git submodule sync && git submodule update
You must run this on the server; so probably best to add it to your hooks/post-receive
script. It is simple BASH or SH, bytheway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With