uhl-cap-recipes 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/Capfile +4 -0
  2. data/LICENSE +20 -0
  3. data/README.textile +586 -0
  4. data/Rakefile +61 -0
  5. data/VERSION.yml +5 -0
  6. data/bin/cap-recipes +4 -0
  7. data/cap-recipes.gemspec +128 -0
  8. data/config/deploy.rb +35 -0
  9. data/examples/advanced/deploy.rb +39 -0
  10. data/examples/advanced/deploy/experimental.rb +14 -0
  11. data/examples/advanced/deploy/production.rb +20 -0
  12. data/examples/simple/deploy.rb +36 -0
  13. data/lib/cap_recipes.rb +1 -0
  14. data/lib/cap_recipes/tasks/gitdeploy.rb +1 -0
  15. data/lib/cap_recipes/tasks/gitdeploy/setup.rb +180 -0
  16. data/lib/cap_recipes/tasks/http.rb +102 -0
  17. data/lib/cap_recipes/tasks/play.rb +201 -0
  18. data/lib/cap_recipes/tasks/sdpdeploy/autoinstall.rb +78 -0
  19. data/lib/cap_recipes/tasks/sdpdeploy/iis.rb +72 -0
  20. data/lib/cap_recipes/tasks/sdpdeploy/sft.rb +1 -0
  21. data/lib/cap_recipes/tasks/sdpdeploy/sfttask.rb +272 -0
  22. data/lib/cap_recipes/tasks/templates/hudson.erb +85 -0
  23. data/lib/cap_recipes/tasks/templates/mongod.conf.erb +89 -0
  24. data/lib/cap_recipes/tasks/templates/mongodb.init.erb +73 -0
  25. data/lib/cap_recipes/tasks/templates/mongodb.repo.erb +4 -0
  26. data/lib/cap_recipes/tasks/templates/mongos.init.erb +69 -0
  27. data/lib/cap_recipes/tasks/templates/tomcat.erb +95 -0
  28. data/lib/cap_recipes/tasks/uhljenkins.rb +217 -0
  29. data/lib/cap_recipes/tasks/utilities.rb +172 -0
  30. data/lib/capify.rb +35 -0
  31. data/lib/templates/Capfile.tt +4 -0
  32. data/lib/templates/deploy.rb.tt +30 -0
  33. data/spec/cap/all/Capfile +2 -0
  34. data/spec/cap/helper.rb +3 -0
  35. data/spec/cap_recipes_spec.rb +56 -0
  36. data/spec/spec_helper.rb +37 -0
  37. data/specs.watchr +35 -0
  38. data/test.rb +105 -0
  39. metadata +118 -0
data/Rakefile ADDED
@@ -0,0 +1,61 @@
1
+ =begin
2
+ Using Jeweler for Gem Packaging...
3
+
4
+ * Update the version and release version to github:
5
+ $ rake version:bump:patch && rake release && rake gemcutter:release
6
+
7
+ * Build and install the latest version locally:
8
+ $ rake install
9
+
10
+ =end
11
+
12
+ require 'rake'
13
+ require 'rake/testtask'
14
+ require 'rake/rdoctask'
15
+
16
+ begin
17
+ require 'jeweler'
18
+ Jeweler::Tasks.new do |s|
19
+ s.name = "uhl-cap-recipes"
20
+ s.summary = %Q{Battle-tested capistrano recipes for passenger, delayed_job, and more}
21
+ s.email = "crazycode@gmail.com"
22
+ s.homepage = "http://github.com/crazycode/uhl-cap-recipes"
23
+ s.description = "capistrano recipes for my works"
24
+ s.authors = ["crazycode"]
25
+ s.rubyforge_project = 'uhl-cap-recipes'
26
+
27
+ s.add_dependency "capistrano"
28
+ s.add_dependency "json"
29
+ s.add_dependency "addressable"
30
+ end
31
+ Jeweler::GemcutterTasks.new
32
+ rescue LoadError
33
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
34
+ end
35
+
36
+ Rake::RDocTask.new do |rdoc|
37
+ rdoc.rdoc_dir = 'rdoc'
38
+ rdoc.title = 'uhl-cap-recipes'
39
+ rdoc.options << '--line-numbers' << '--inline-source'
40
+ rdoc.rdoc_files.include('README*')
41
+ rdoc.rdoc_files.include('lib/**/*.rb')
42
+ end
43
+
44
+ begin
45
+ require 'rcov/rcovtask'
46
+ Rcov::RcovTask.new do |t|
47
+ t.libs << 'test'
48
+ t.test_files = FileList['test/**/*_test.rb']
49
+ t.verbose = true
50
+ end
51
+ rescue LoadError
52
+ end
53
+
54
+ desc "Run all specs in spec directory"
55
+ task :spec do |t|
56
+ options = "--colour --format progress --loadby --reverse"
57
+ files = FileList['spec/**/*_spec.rb']
58
+ system("spec #{options} #{files}")
59
+ end
60
+
61
+ task :default => :spec
data/VERSION.yml ADDED
@@ -0,0 +1,5 @@
1
+ ---
2
+ :major: 0
3
+ :minor: 1
4
+ :patch: 0
5
+ :build:
data/bin/cap-recipes ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../lib/capify'
3
+
4
+ CapRecipes.start(ARGV)
@@ -0,0 +1,128 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{cap-recipes}
8
+ s.version = "0.3.36"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Nathan Esquenazi"]
12
+ s.date = %q{2010-10-12}
13
+ s.default_executable = %q{cap-recipes}
14
+ s.description = %q{Battle-tested capistrano recipes for debian, passenger, apache, delayed_job, juggernaut, rubygems, backgroundrb, rails and more}
15
+ s.email = %q{nesquena@gmail.com}
16
+ s.executables = ["cap-recipes"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.textile"
20
+ ]
21
+ s.files = [
22
+ ".gitignore",
23
+ "LICENSE",
24
+ "README.textile",
25
+ "Rakefile",
26
+ "VERSION.yml",
27
+ "bin/cap-recipes",
28
+ "cap-recipes.gemspec",
29
+ "examples/advanced/deploy.rb",
30
+ "examples/advanced/deploy/experimental.rb",
31
+ "examples/advanced/deploy/production.rb",
32
+ "examples/simple/deploy.rb",
33
+ "lib/cap_recipes.rb",
34
+ "lib/cap_recipes/tasks/apache.rb",
35
+ "lib/cap_recipes/tasks/apache/install.rb",
36
+ "lib/cap_recipes/tasks/apache/manage.rb",
37
+ "lib/cap_recipes/tasks/aptitude.rb",
38
+ "lib/cap_recipes/tasks/aptitude/manage.rb",
39
+ "lib/cap_recipes/tasks/backgroundrb.rb",
40
+ "lib/cap_recipes/tasks/backgroundrb/hooks.rb",
41
+ "lib/cap_recipes/tasks/backgroundrb/manage.rb",
42
+ "lib/cap_recipes/tasks/bundler.rb",
43
+ "lib/cap_recipes/tasks/bundler/manage.rb",
44
+ "lib/cap_recipes/tasks/delayed_job.rb",
45
+ "lib/cap_recipes/tasks/delayed_job/hooks.rb",
46
+ "lib/cap_recipes/tasks/delayed_job/manage.rb",
47
+ "lib/cap_recipes/tasks/ec2/install.rb",
48
+ "lib/cap_recipes/tasks/ec2/manage.rb",
49
+ "lib/cap_recipes/tasks/gitosis.rb",
50
+ "lib/cap_recipes/tasks/gitosis/install.rb",
51
+ "lib/cap_recipes/tasks/gitosis/manage.rb",
52
+ "lib/cap_recipes/tasks/jetty.rb",
53
+ "lib/cap_recipes/tasks/jetty/install.rb",
54
+ "lib/cap_recipes/tasks/jetty/manage.rb",
55
+ "lib/cap_recipes/tasks/jetty/web.rb",
56
+ "lib/cap_recipes/tasks/juggernaut.rb",
57
+ "lib/cap_recipes/tasks/juggernaut/hooks.rb",
58
+ "lib/cap_recipes/tasks/juggernaut/manage.rb",
59
+ "lib/cap_recipes/tasks/maven.rb",
60
+ "lib/cap_recipes/tasks/memcache.rb",
61
+ "lib/cap_recipes/tasks/memcache/hooks.rb",
62
+ "lib/cap_recipes/tasks/memcache/install.rb",
63
+ "lib/cap_recipes/tasks/memcache/manage.rb",
64
+ "lib/cap_recipes/tasks/mongodb.rb",
65
+ "lib/cap_recipes/tasks/mongodb/install.rb",
66
+ "lib/cap_recipes/tasks/mongodb/manage.rb",
67
+ "lib/cap_recipes/tasks/passenger.rb",
68
+ "lib/cap_recipes/tasks/passenger/install.rb",
69
+ "lib/cap_recipes/tasks/passenger/manage.rb",
70
+ "lib/cap_recipes/tasks/rails.rb",
71
+ "lib/cap_recipes/tasks/rails/hooks.rb",
72
+ "lib/cap_recipes/tasks/rails/manage.rb",
73
+ "lib/cap_recipes/tasks/ruby.rb",
74
+ "lib/cap_recipes/tasks/ruby/install.rb",
75
+ "lib/cap_recipes/tasks/rubygems.rb",
76
+ "lib/cap_recipes/tasks/rubygems/install.rb",
77
+ "lib/cap_recipes/tasks/rubygems/manage.rb",
78
+ "lib/cap_recipes/tasks/templates/tomcat.erb",
79
+ "lib/cap_recipes/tasks/thinking_sphinx.rb",
80
+ "lib/cap_recipes/tasks/thinking_sphinx/hooks.rb",
81
+ "lib/cap_recipes/tasks/thinking_sphinx/install.rb",
82
+ "lib/cap_recipes/tasks/thinking_sphinx/manage.rb",
83
+ "lib/cap_recipes/tasks/tomcat.rb",
84
+ "lib/cap_recipes/tasks/tomcat/install.rb",
85
+ "lib/cap_recipes/tasks/tomcat/manage.rb",
86
+ "lib/cap_recipes/tasks/tomcat/war.rb",
87
+ "lib/cap_recipes/tasks/utilities.rb",
88
+ "lib/cap_recipes/tasks/whenever.rb",
89
+ "lib/cap_recipes/tasks/whenever/hooks.rb",
90
+ "lib/cap_recipes/tasks/whenever/manage.rb",
91
+ "lib/cap_recipes/tasks/yum.rb",
92
+ "lib/cap_recipes/tasks/yum/manage.rb",
93
+ "lib/capify.rb",
94
+ "lib/templates/Capfile.tt",
95
+ "lib/templates/deploy.rb.tt",
96
+ "spec/cap/all/Capfile",
97
+ "spec/cap/helper.rb",
98
+ "spec/cap_recipes_spec.rb",
99
+ "spec/spec_helper.rb",
100
+ "specs.watchr"
101
+ ]
102
+ s.homepage = %q{http://github.com/nesquena/cap-recipes}
103
+ s.rdoc_options = ["--charset=UTF-8"]
104
+ s.require_paths = ["lib"]
105
+ s.rubyforge_project = %q{cap-recipes}
106
+ s.rubygems_version = %q{1.3.7}
107
+ s.summary = %q{Battle-tested capistrano recipes for passenger, delayed_job, and more}
108
+ s.test_files = [
109
+ "spec/cap_recipes_spec.rb",
110
+ "spec/spec_helper.rb",
111
+ "spec/cap/helper.rb",
112
+ "examples/advanced/deploy/production.rb",
113
+ "examples/advanced/deploy/experimental.rb",
114
+ "examples/advanced/deploy.rb",
115
+ "examples/simple/deploy.rb"
116
+ ]
117
+
118
+ if s.respond_to? :specification_version then
119
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
120
+ s.specification_version = 3
121
+
122
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
123
+ else
124
+ end
125
+ else
126
+ end
127
+ end
128
+
data/config/deploy.rb ADDED
@@ -0,0 +1,35 @@
1
+ # -*- coding: utf-8 -*-
2
+ # =============================================================================
3
+ # GENERAL SETTINGS
4
+ # =============================================================================
5
+
6
+ role :app, "10.241.14.166"
7
+
8
+ set :application, "demo"
9
+ set :deploy_to, "/var/apps/#{application}"
10
+ # set :deploy_via, :remote_cache
11
+ # set :scm, :git
12
+ # set :repository, "deploy@dev.demo.com:/home/demo.git"
13
+ # set :git_enable_submodules, 1
14
+ # set :keep_releases, 3
15
+
16
+ set :user, "pm030"
17
+ set :use_sudo, true
18
+
19
+ ssh_options[:paranoid] = false
20
+ default_run_options[:pty] = true
21
+
22
+ set :user, "root"
23
+
24
+ # =============================================================================
25
+ # RECIPE INCLUDES
26
+ # =============================================================================
27
+
28
+ require 'rubygems'
29
+ # for development
30
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
31
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
32
+
33
+ require 'cap_recipes/tasks/sdpjenkins'
34
+ require 'cap_recipes/tasks/gitdeploy'
35
+ require 'cap_recipes/tasks/sft'
@@ -0,0 +1,39 @@
1
+ # =============================================================================
2
+ # GENERAL SETTINGS
3
+ # =============================================================================
4
+
5
+ set :application, "demo"
6
+ set :deploy_to, "/var/apps/#{application}"
7
+ set :deploy_via, :remote_cache
8
+ set :scm, :git
9
+ set :repository, "deploy@dev.demo.com:/home/demo.git"
10
+ set :git_enable_submodules, 1
11
+ set :keep_releases, 3
12
+
13
+ # =============================================================================
14
+ # STAGE SETTINGS
15
+ # =============================================================================
16
+
17
+ # set :default_stage, "experimental"
18
+ set :stages, %w(production experimental)
19
+ set :default_stage, "experimental"
20
+ require 'capistrano/ext/multistage'
21
+
22
+ # =============================================================================
23
+ # RECIPE INCLUDES
24
+ # =============================================================================
25
+
26
+ require 'rubygems'
27
+ require 'cap_recipes/tasks/whenever'
28
+ require 'cap_recipes/tasks/apache'
29
+ require 'cap_recipes/tasks/passenger'
30
+ require 'cap_recipes/tasks/memcache'
31
+ require 'cap_recipes/tasks/juggernaut'
32
+ require 'cap_recipes/tasks/delayed_job'
33
+ require 'cap_recipes/tasks/rails'
34
+
35
+ ssh_options[:paranoid] = false
36
+ default_run_options[:pty] = true
37
+
38
+ # PASSENGER
39
+ set :base_ruby_path, '/opt/ruby-enterprise' # not /usr
@@ -0,0 +1,14 @@
1
+ # Domain
2
+ role :web, "stage.app.com"
3
+ role :app, "stage.app.com"
4
+ role :db, "stage.app.com", :primary => true
5
+
6
+ # GENERAL
7
+ set :user, "deploy"
8
+ set :runner, "deploy"
9
+ set :password, "demo567"
10
+ set :use_sudo, true
11
+ ssh_options[:keys] = [File.join(ENV["HOME"], ".ssh", "demo")]
12
+
13
+ # Branch
14
+ set :branch, 'develop'
@@ -0,0 +1,20 @@
1
+ # Domain
2
+ role :web, "demo.app.com"
3
+ role :app, "demo.app.com"
4
+ role :db, "demo.app.com", :primary => true
5
+ role :juggernaut, "juggernaut.app.com", :no_release => true
6
+ role :delayed_job, "dj.app.com", :no_release => true
7
+ role :memcache, "memcache.app.com", :no_release => true
8
+
9
+ # GENERAL
10
+ set :user, "deploy"
11
+ set :runner, "deploy"
12
+ set :password, "demo567"
13
+ set :use_sudo, true
14
+ set :juggernaut_role, :juggernaut
15
+ set :delayed_job_role, :delayed_job
16
+ set :memcache_role, :memcache
17
+ ssh_options[:keys] = [File.join(ENV["HOME"], ".ssh", "demo")]
18
+
19
+ # Branch
20
+ set :branch, 'master'
@@ -0,0 +1,36 @@
1
+ # =============================================================================
2
+ # GENERAL SETTINGS
3
+ # =============================================================================
4
+
5
+ role :web, "demo.app.com"
6
+ role :app, "demo.app.com"
7
+ role :db, "demo.app.com", :primary => true
8
+
9
+ set :application, "demo"
10
+ set :deploy_to, "/var/apps/#{application}"
11
+ set :deploy_via, :remote_cache
12
+ set :scm, :git
13
+ set :repository, "deploy@dev.demo.com:/home/demo.git"
14
+ set :git_enable_submodules, 1
15
+ set :keep_releases, 3
16
+ set :user, "deploy"
17
+ set :runner, "deploy"
18
+ set :password, "demo567"
19
+ set :use_sudo, true
20
+ set :branch, 'production'
21
+
22
+ # =============================================================================
23
+ # RECIPE INCLUDES
24
+ # =============================================================================
25
+
26
+ require 'rubygems'
27
+ require 'cap_recipes/tasks/whenever'
28
+ require 'cap_recipes/tasks/apache'
29
+ require 'cap_recipes/tasks/passenger'
30
+ require 'cap_recipes/tasks/memcache'
31
+ require 'cap_recipes/tasks/juggernaut'
32
+ require 'cap_recipes/tasks/delayed_job'
33
+ require 'cap_recipes/tasks/rails'
34
+
35
+ ssh_options[:paranoid] = false
36
+ default_run_options[:pty] = true
@@ -0,0 +1 @@
1
+ Dir[File.join(File.dirname(__FILE__), 'cap_recipes/tasks/*.rb')].sort.each { |lib| require lib }
@@ -0,0 +1 @@
1
+ Dir[File.join(File.dirname(__FILE__), 'gitdeploy/*.rb')].sort.each { |lib| require lib }
@@ -0,0 +1,180 @@
1
+ # -*- coding: utf-8 -*-
2
+ Capistrano::Configuration.instance(true).load do |configuration|
3
+ set :use_sudo, true
4
+
5
+ _cset :deploy_to_parent, "/srv/applications"
6
+ _cset :branch, "master"
7
+
8
+ default_run_options[:pty] = true
9
+
10
+ # this is capistrano's default location.
11
+ # depending on the permissions of the server
12
+ # you may need to create it and chown it over
13
+ # to :user (e.g. chown -R robotuser:robotuser /u)
14
+ set :deploy_to do
15
+ "#{deploy_to_parent}/#{application}"
16
+ end
17
+
18
+ set :deploy_to_gitrepo do
19
+ "#{deploy_to}/gitrepo"
20
+ end
21
+
22
+
23
+ set :local_base_dir do
24
+ "#{`pwd`}".strip
25
+ end
26
+
27
+ _cset :war_config, Array.new
28
+ _cset :war_name, ""
29
+ _cset :war_path, "not set.war"
30
+
31
+ _cset :servers, ""
32
+ _cset :deploy_to, ""
33
+
34
+ set :local_git_dir do
35
+ "/tmp/localgit_#{application}"
36
+ end
37
+ set :local_gitrepo do
38
+ "#{local_git_dir}/#{application}"
39
+ end
40
+
41
+ namespace :gitdeploy do
42
+
43
+ desc "setup remote and locate gitdeploy dir"
44
+ task :setup do
45
+ gitdeploy.setup_remote
46
+ gitdeploy.setup_local
47
+ end
48
+
49
+ desc "setup remote gitdeploy dir"
50
+ task :setup_remote do
51
+ run clone_repository_command()
52
+ end
53
+
54
+ desc "setup locate gitdeploy dir"
55
+ task :setup_local do
56
+ system clone_repository_local_command()
57
+ end
58
+
59
+ desc "tag build version. use -s tag=xxx to set tag's name"
60
+ task :tag do
61
+ gitdeploy.setup_local
62
+
63
+ system "cd #{local_gitrepo}; git checkout #{branch}; git fetch; git merge origin/#{branch};"
64
+
65
+
66
+ unless war_name.empty?
67
+ puts "name=#{war_name}, war=#{war_path}"
68
+ system update_repository_local_command(war_name, war_path)
69
+ else
70
+ if war_config.nil? or war_config.size == 0
71
+ raise 'NO war_config'
72
+ end
73
+ war_config.each do |config|
74
+ puts "name=#{config[:name]}, war=#{config[:war]}"
75
+ system update_repository_local_command(config[:name], config[:war])
76
+ end
77
+ end
78
+
79
+ tag_name = configuration[:tag] || configuration[:build_version]
80
+ if tag_name.nil?
81
+ build_msg = war_name.empty? ? "all" : war_name
82
+ system "cd #{local_gitrepo}; git add .; git commit -m 'build for #{build_msg}'"
83
+ # raise "NO tag. pls use -s tag=xxx set tag_name"
84
+ else
85
+ system "cd #{local_gitrepo}; git add .; git commit -m 'tag with #{tag_name}'; git tag #{tag_name};"
86
+ end
87
+
88
+
89
+ # push tags and latest code
90
+ system "cd #{local_gitrepo}; git push origin #{branch}"
91
+ if $? != 0
92
+ raise "git push failed"
93
+ end
94
+
95
+ system "cd #{local_gitrepo}; git push origin #{branch} --tags"
96
+ if $? != 0
97
+ raise "git push --tags failed"
98
+ end
99
+ end
100
+
101
+ desc "deploy tagged version. use -s tag=xxx to set tag's name"
102
+ task :deploy do
103
+ tag_name = configuration[:tag] || configuration[:build_version]
104
+ if tag_name.nil?
105
+ raise "NO tag. pls use -s tag=xxx set tag_name"
106
+ end
107
+
108
+ run update_repository_remote_command(tag_name)
109
+ end
110
+
111
+ desc "register servers and deploy_dir on CMDB"
112
+ task :register_servers do
113
+ version = build_version
114
+ puts "version=#{version}, servers=#{servers}, deploy_dir=#{deploy_to}"
115
+ CmdbService.start_deploy_with_server(cse_base, deploy_unit_code, deploy_stage, version.strip, servers, deploy_to)
116
+ end
117
+
118
+ desc "send deploy success info to CMDB"
119
+ task :deploy_succ do
120
+ CmdbService.complete_deploy(cse_base, deploy_unit_code, deploy_stage, true, "部署成功")
121
+ end
122
+
123
+ desc "send deploy failure info to CMDB"
124
+ task :deploy_fail do
125
+ CmdbService.complete_deploy(cse_base, deploy_unit_code, deploy_stage, false, "capistrano部署失败,撤销发布。")
126
+ end
127
+
128
+
129
+ def self.clone_repository_local_command
130
+ [
131
+ "if [ ! -e #{local_git_dir} ]",
132
+ "then mkdir -p #{local_git_dir}",
133
+ "cd #{local_git_dir}",
134
+ "git clone #{repository} #{local_gitrepo}",
135
+ "fi"
136
+ ].join("; ")
137
+ end
138
+
139
+
140
+ def self.update_repository_local_command(name, war)
141
+ unless war.start_with?('/')
142
+ war_path = "#{local_base_dir}/#{war}"
143
+ else
144
+ war_path = war
145
+ end
146
+ [
147
+ "cd #{local_gitrepo}",
148
+ "if [ -e #{local_gitrepo}/#{name} ]",
149
+ "then git rm -rf #{local_gitrepo}/#{name}",
150
+ "fi",
151
+ "mkdir -p #{local_gitrepo}/#{name}",
152
+ "cd #{local_gitrepo}/#{name}",
153
+ "jar -xf #{war_path}"
154
+ ].join("; ")
155
+ end
156
+
157
+ def self.clone_repository_command
158
+ [
159
+ "if [ ! -e #{deploy_to_gitrepo} ]",
160
+ "then sudo mkdir -p #{deploy_to}",
161
+ "sudo chown #{user} #{deploy_to}",
162
+ "cd #{deploy_to}",
163
+ "git clone #{repository} #{deploy_to_gitrepo}",
164
+ "fi"
165
+ ].join("; ")
166
+ end
167
+
168
+ def self.update_repository_remote_command(tag_name)
169
+ [
170
+ # git reset --hard;git fetch;git reset --merge #{tag_name}
171
+ "cd #{deploy_to_gitrepo}",
172
+ "git reset --hard",
173
+ "git fetch",
174
+ "git reset --merge #{tag_name}",
175
+ ].join("; ")
176
+ end
177
+
178
+ end
179
+
180
+ end