diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-08-08 15:45:42 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-08-08 15:45:42 +0100 |
commit | 658ec0316c6a1cc8eda658d50a1ff0d5255d651a (patch) | |
tree | 44b18e074756baf28d266baf1b237362d19c0369 | |
parent | f6de092081d5c083d78817e2d2ac044ba50d734d (diff) | |
parent | 9f62a26384232890d8dcdc56cd5983b793db3be1 (diff) |
Merge branch 'feature/check-submodules' into rails-3-develop
-rw-r--r-- | lib/tasks/submodules.rake | 28 | ||||
-rwxr-xr-x | script/rails-post-deploy | 2 |
2 files changed, 30 insertions, 0 deletions
diff --git a/lib/tasks/submodules.rake b/lib/tasks/submodules.rake new file mode 100644 index 000000000..426192713 --- /dev/null +++ b/lib/tasks/submodules.rake @@ -0,0 +1,28 @@ + +namespace :submodules do + + desc "Check the status of the project's submodules" + task :check => :environment do + commit_info = `git submodule status commonlib` + case commit_info[0,1] + when '+' + $stderr.puts "Error: Currently checked out submodule commit for commonlib" + $stderr.puts "does not match the commit expected by this version of Alaveteli." + $stderr.puts "You can update it with 'git submodule update'." + exit(1) + when '-' + $stderr.puts "Error: Submodule commonlib needs to be initialized." + $stderr.puts "You can do this by running 'git submodule update --init'." + exit(1) + when 'U' + $stderr.puts "Error: Submodule commonlib has merge conflicts." + $stderr.puts "You'll need to resolve these to run Alaveteli." + exit(1) + when ' ' + exit(0) + else + raise "Unexpected status character in response to 'git submodule status commonlib': #{commit_info[0,1]}" + end + end + +end diff --git a/script/rails-post-deploy b/script/rails-post-deploy index a3257cf35..d20bf0472 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -93,6 +93,8 @@ bundle install $bundle_install_options bundle exec rake themes:install +bundle exec rake submodules:check + # upgrade database bundle exec rake db:migrate #--trace |