Last active
October 20, 2024 14:30
-
-
Save mbbx6spp/154482 to your computer and use it in GitHub Desktop.
Git (submodule) Capistrano tasks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 2009 Copyright Susan Potter <me at susanpotter dot net> | |
# You can read her software development rants at: https://www.susanpotter.net/software/ | |
# Released under CreativeCommons-attribution-noncommercial-sharealike license: | |
# http://creativecommons.org/licenses/by-nc-sa/1.0/ | |
namespace :git do | |
namespace :submodule do | |
desc "Initializes submodules" | |
task :init, :roles => :app do | |
invoke_command "cd #{current_path} && git submodule init", :via => run_method | |
end | |
desc "Updates submodules" | |
task :update, :roles => :app do | |
invoke_command "cd #{current_path} && git submodule update", :via => run_method | |
end | |
desc "Initializes and updates submodules" | |
task :pull, :roles => :app do | |
git.submodule.init | |
git.submodule.update | |
end | |
end | |
desc "Pull latest code" | |
task :pull, :roles => :app do | |
invoke_command "cd #{current_path} && git checkout #{env} && git pull origin #{env}", :via => run_method | |
end | |
desc "Refresh repository to origin/#{env} branch" | |
task :refresh, :roles => :app do | |
git.pull | |
git.submodule.pull | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment