openteam-capistrano 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 129936edfc9b9058697f0cb67ad58dfecb97bf33
4
- data.tar.gz: e593870a3df166c80aa0adb320612cfa042d6f1a
3
+ metadata.gz: 74c7a6caf1cfc946ecedce23e9b2a023a39d5683
4
+ data.tar.gz: a14e6fd8c88cc84f1305baf681e9d87a858d1852
5
5
  SHA512:
6
- metadata.gz: 62d3a2a3f2fcd2c129c777996fad7331aee13d6453b01cc6f6336e8a8989cbd4530ddf74b2b302d7d0b8620d3ee36630a174593a6802b1382696f41d666ee0d6
7
- data.tar.gz: ae05bd30823a176acdb8978303a4da9057e359bb1b01b47682d5572daa2917dd622616016959032daa412e629e61a1b1f85ffa446b8252d559dc45b77566d8c2
6
+ metadata.gz: cab9471f8e461f281e0f13f189259a38b6668367306e44a8f794a092124596fac10355150ed27619f71438d113e65395f5bcf48bfc49b3d1618218c84c5a0936
7
+ data.tar.gz: 74f5d7d20d5bf439654c94e27079edc38686e0d7e37422006ed8070767823fb7f46d8bcb1695c76c1d5f5f789cc14a12e1d2084bdc4a58fc562951ec545baf9f
data/README.md CHANGED
@@ -1,34 +1,47 @@
1
1
  # Openteam::Capistrano
2
2
 
3
- TODO: Write a gem description
3
+ Добавлена поддержка Capistrano v3.
4
4
 
5
- ## Installation
5
+ ## Установка
6
6
 
7
- Add this line to your application's Gemfile:
7
+ Добавить в Gemfile:
8
8
 
9
- gem 'openteam-capistrano', '~> 1.0.0', :require => false
9
+ gem 'openteam-capistrano', '~> 1.0.0'
10
10
 
11
- And then execute:
11
+ Затем выполнить:
12
12
 
13
13
  $ bundle
14
14
 
15
- Or install it yourself as:
15
+ Или установить gem:
16
16
 
17
17
  $ gem install openteam-capistrano
18
18
 
19
- ## Usage
19
+ ## Использование
20
20
 
21
- * Удаляем все что связано с capistrano v2
21
+ * Удаляем все что связано с capistrano v2 (Capfile, config/deploy.rb, config/deploy/)
22
22
  * Ставим gem openteam-capistrano
23
23
 
24
+ Запускаем генератор:
25
+
26
+ $ rails g openteam:capistrano:install
27
+
28
+ Деплой приложения:
29
+
30
+ $ bundle exec cap STAGE deploy
31
+
32
+ или:
33
+
34
+ $ bin/cap STAGE deploy
35
+
24
36
  ## Схема работы с бренчами
25
37
 
26
- В openteam-capistrano изменилась схема деплоя.
38
+ В Capistrano v3 изменилась схема работы со стейджами - теперь обязательно указывать стейдж при деплое. Опция set :default_stage была удалена.
39
+
40
+ В папке config/deploy/ должен лежать пустой файл с именем стейджа, деплой должен происходить из бранча с таким же именем что и стейдж.
27
41
 
28
- ## Contributing
42
+ В бренч из которого производится деплой нельзя делать комиты. Разработка ведется в мастере! Перед деплоем делаем:
29
43
 
30
- 1. Fork it
31
- 2. Create your feature branch (`git checkout -b my-new-feature`)
32
- 3. Commit your changes (`git commit -am 'Add some feature'`)
33
- 4. Push to the branch (`git push origin my-new-feature`)
34
- 5. Create new Pull Request
44
+ $ git checkout BRANCH
45
+ $ git rebase master
46
+ $ bundle exec cap BRANCH deploy
47
+
@@ -14,6 +14,10 @@ module Openteam
14
14
  def create_deploy_stages
15
15
  template 'config/deploy/production.rb'
16
16
  end
17
+
18
+ def create_unicorn_config
19
+ template 'config/unicorn.rb'
20
+ end
17
21
  end
18
22
  end
19
23
  end
@@ -0,0 +1,45 @@
1
+ # ------------------------------------------------------------------------------
2
+ # Sample rails 3 config
3
+ # ------------------------------------------------------------------------------
4
+
5
+ # Set your full path to application.
6
+ app_dir = File.expand_path('../../', __FILE__)
7
+
8
+ # Set unicorn options
9
+ worker_processes 2
10
+ preload_app true
11
+ timeout 360
12
+
13
+ # Fill path to your app
14
+ working_directory app_dir
15
+
16
+ # Set up socket location
17
+ listen "#{app_dir}/tmp/sockets/unicorn.sock", :backlog => 64
18
+
19
+ # Loging
20
+ stderr_path "#{app_dir}/log/unicorn.stderr.log"
21
+ stdout_path "#{app_dir}/log/unicorn.stdout.log"
22
+
23
+ # Set master PID location
24
+ pid "#{app_dir}/tmp/pids/unicorn.pid"
25
+
26
+ before_fork do |server, worker|
27
+ defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect!
28
+ old_pid = "#{server.config[:pid]}.oldbin"
29
+ if File.exists?(old_pid) && server.pid != old_pid
30
+ begin
31
+ sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
32
+ Process.kill(sig, File.read(old_pid).to_i)
33
+ rescue Errno::ENOENT, Errno::ESRCH
34
+ # someone else did our job for us
35
+ end
36
+ end
37
+ end
38
+
39
+ after_fork do |server, worker|
40
+ defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection
41
+ end
42
+
43
+ before_exec do |server|
44
+ ENV['BUNDLE_GEMFILE'] = "#{app_dir}/Gemfile"
45
+ 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 = '1.0.0'
7
+ gem.version = '1.0.1'
8
8
  gem.authors = ["OpenTeam developers"]
9
9
  gem.email = ["developers@openteam.ru"]
10
10
  gem.description = %q{OpenTeam common capistrano3 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: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTeam developers
@@ -124,6 +124,7 @@ files:
124
124
  - lib/generators/openteam/capistrano/templates/Capfile
125
125
  - lib/generators/openteam/capistrano/templates/config/deploy.rb
126
126
  - lib/generators/openteam/capistrano/templates/config/deploy/production.rb
127
+ - lib/generators/openteam/capistrano/templates/config/unicorn.rb
127
128
  - lib/openteam/capistrano.rb
128
129
  - lib/openteam/capistrano/app_config.rb
129
130
  - lib/openteam/capistrano/capistrano_config.rb