Created
April 2, 2017 08:42
-
-
Save tetsuyainfra/cd1b4dac9859f96755249c3f12a42086 to your computer and use it in GitHub Desktop.
Capistranoでdeploy前にgit pushするタスクを追加する
This file contains hidden or 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
#!/bin/sh | |
exec ssh -F keys/ssh_config "$@" |
This file contains hidden or 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
# lib/capistrano/tasks/sync.rake | |
namespace :sync do | |
desc 'run synchronization remote repository' | |
task :git do | |
on roles(:all) do | host | | |
# run command in local | |
run_locally do | |
# if you want ssh warapper | |
with GIT_SSH: "keys/git_ssh.sh" do | |
execute :git, :push, "#{host}", "release/*" | |
end | |
end | |
end | |
end | |
before :deploy, :'sync:git' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment