openteam-capistrano 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,10 @@
1
1
  # set up hooks
2
2
  Capistrano::Configuration.instance.load do
3
- after('multistage:ensure') do
4
- server domain, :app, :web, :db, :primary => true
5
- end
3
+ after 'multistage:ensure', 'openteam:setup'
4
+
5
+ #after('multistage:ensure') do
6
+ #server domain, :app, :web, :db, :primary => true
7
+ #end
6
8
 
7
9
  after 'deploy:update_code', 'deploy:migrate'
8
10
 
@@ -1,38 +1,53 @@
1
1
  Capistrano::Configuration.instance.load do
2
- def deploy_config
3
- @deploy_config ||= YAML::load(File.open('config/deploy.yml'))[stage.to_s]
4
- end
2
+ namespace :openteam do
3
+ task :setup do
4
+ def deploy_config
5
+ @deploy_config ||= YAML::load(File.open('config/deploy.yml'))[stage.to_s]
6
+ end
7
+
8
+ def ssh_git_repository_url
9
+ `git config --get remote.origin.url`.chomp
10
+ end
11
+
12
+ def git_repository_url
13
+ @git_repository_url ||= ssh_git_repository_url.gsub(/^git@(.+?):(.+)$/, 'git://\1/\2')
14
+ end
5
15
 
6
- set(:application) { deploy_config['application'] }
7
- set(:domain) { deploy_config['domain'] }
8
- set(:gateway) { deploy_config['gateway'] }
16
+ set :application, deploy_config['application']
17
+ set :domain, deploy_config['domain']
18
+ set :gateway, deploy_config['gateway'] if deploy_config.has_key? 'gateway'
9
19
 
10
- set(:deploy_to) { "/srv/#{application}" }
20
+ set :deploy_to, "/srv/#{application}"
11
21
 
12
- # source repostitory settings
13
- set :scm, :git
14
- set(:repository) { `git config --get remote.origin.url`.strip }
15
- set :branch, :master
16
- set :deploy_via, :remote_cache
17
- set :ssh_options, { :forward_agent => true }
22
+ # source repostitory settings
23
+ set :scm, :git
24
+ set :repository, git_repository_url
25
+ set :branch, :master
26
+ set :deploy_via, :remote_cache
27
+ set :ssh_options, {:forward_agent => true}
18
28
 
19
- # this files will be symlinked from shared to current path on deploy
20
- set :shared_children, %w[config/settings.yml config/database.yml log tmp/sockets tmp/pids]
29
+ # this files will be symlinked from shared to current path on deploy
30
+ set :shared_children, %w[config/settings.yml config/database.yml log tmp/sockets tmp/pids]
21
31
 
22
- # for assets compilation on host with nodejs
23
- set :default_shell, 'bash -l'
32
+ # for assets compilation on host with nodejs
33
+ set :default_shell, 'bash -l'
24
34
 
25
- # make bin stubs for candy console rails runs
26
- set :bundle_flags, '--binstubs --deployment --quiet'
35
+ # make bin stubs for candy console rails runs
36
+ set :bundle_flags, '--binstubs --deployment --quiet'
27
37
 
28
- # gem capistrano-db-tasks
29
- # we do not need dump file after db:pull
30
- set :db_local_clean, true
38
+ # gem capistrano-db-tasks
39
+ # we do not need dump file after db:pull
40
+ set :db_local_clean, true
31
41
 
32
- # gem whenever
33
- # point to bundled version of whenever command
34
- set :whenever_command, 'bundle exec whenever'
42
+ # gem whenever
43
+ # point to bundled version of whenever command
44
+ set :whenever_command, 'bundle exec whenever'
35
45
 
36
- # tagging needs this
37
- set :local_user, ENV['USER'] || ENV['USERNAME']
46
+ # tagging needs this
47
+ set :local_user, ENV['USER'] || ENV['USERNAME']
48
+
49
+ # setup server
50
+ server domain, :app, :web, :db, :primary => true
51
+ end
52
+ end
38
53
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = 'openteam-capistrano'
7
- gem.version = '0.0.1'
7
+ gem.version = '0.0.2'
8
8
  gem.authors = ["OpenTeam developers"]
9
9
  gem.email = ["developers@openteam.ru"]
10
10
  gem.description = %q{OpenTeam common capistrano recipe}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openteam-capistrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -123,7 +123,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  segments:
125
125
  - 0
126
- hash: 3262326284942122593
126
+ hash: 3229573802702059234
127
127
  required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  none: false
129
129
  requirements:
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  version: '0'
133
133
  segments:
134
134
  - 0
135
- hash: 3262326284942122593
135
+ hash: 3229573802702059234
136
136
  requirements: []
137
137
  rubyforge_project:
138
138
  rubygems_version: 1.8.24