openteam-capistrano 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74c7a6caf1cfc946ecedce23e9b2a023a39d5683
|
4
|
+
data.tar.gz: a14e6fd8c88cc84f1305baf681e9d87a858d1852
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cab9471f8e461f281e0f13f189259a38b6668367306e44a8f794a092124596fac10355150ed27619f71438d113e65395f5bcf48bfc49b3d1618218c84c5a0936
|
7
|
+
data.tar.gz: 74f5d7d20d5bf439654c94e27079edc38686e0d7e37422006ed8070767823fb7f46d8bcb1695c76c1d5f5f789cc14a12e1d2084bdc4a58fc562951ec545baf9f
|
data/README.md
CHANGED
@@ -1,34 +1,47 @@
|
|
1
1
|
# Openteam::Capistrano
|
2
2
|
|
3
|
-
|
3
|
+
Добавлена поддержка Capistrano v3.
|
4
4
|
|
5
|
-
##
|
5
|
+
## Установка
|
6
6
|
|
7
|
-
|
7
|
+
Добавить в Gemfile:
|
8
8
|
|
9
|
-
gem 'openteam-capistrano', '~> 1.0.0'
|
9
|
+
gem 'openteam-capistrano', '~> 1.0.0'
|
10
10
|
|
11
|
-
|
11
|
+
Затем выполнить:
|
12
12
|
|
13
13
|
$ bundle
|
14
14
|
|
15
|
-
|
15
|
+
Или установить gem:
|
16
16
|
|
17
17
|
$ gem install openteam-capistrano
|
18
18
|
|
19
|
-
##
|
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
|
-
В
|
38
|
+
В Capistrano v3 изменилась схема работы со стейджами - теперь обязательно указывать стейдж при деплое. Опция set :default_stage была удалена.
|
39
|
+
|
40
|
+
В папке config/deploy/ должен лежать пустой файл с именем стейджа, деплой должен происходить из бранча с таким же именем что и стейдж.
|
27
41
|
|
28
|
-
|
42
|
+
В бренч из которого производится деплой нельзя делать комиты. Разработка ведется в мастере! Перед деплоем делаем:
|
29
43
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
5. Create new Pull Request
|
44
|
+
$ git checkout BRANCH
|
45
|
+
$ git rebase master
|
46
|
+
$ bundle exec cap BRANCH deploy
|
47
|
+
|
@@ -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
|
data/openteam-capistrano.gemspec
CHANGED
@@ -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.
|
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.
|
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
|