uniq-deploy 0.0.1 → 1.0.0
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.
- data/lib/uniq-deploy.rb +49 -45
- metadata +1 -1
data/lib/uniq-deploy.rb
CHANGED
@@ -1,50 +1,54 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
# ==============================================
|
6
|
-
|
7
|
-
|
8
|
-
require '
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
role :web, domain
|
28
|
-
role :db, domain, :primary => true
|
29
|
-
|
30
|
-
namespace :deploy do
|
31
|
-
task :start do ; end
|
32
|
-
task :stop do ; end
|
33
|
-
|
34
|
-
task :restart, :roles => :app do
|
35
|
-
run "touch #{current_path}/tmp/restart.txt"
|
36
|
-
end
|
37
|
-
|
38
|
-
task :symlink_shared, :roles => :app do
|
39
|
-
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
|
40
|
-
end
|
3
|
+
Capistrano::Configuration.instance.load do
|
4
|
+
|
5
|
+
# ==============================================
|
6
|
+
# universal web app UNIQ Systems deployment part
|
7
|
+
# ==============================================
|
8
|
+
require 'rvm/capistrano'
|
9
|
+
require 'bundler/capistrano'
|
10
|
+
require 'capistrano_colors'
|
11
|
+
load "deploy/assets"
|
12
|
+
|
13
|
+
# common variables
|
14
|
+
{
|
15
|
+
repository: "git@red:#{application}.git",
|
16
|
+
domain: "#{application}@production-192",
|
17
|
+
deploy_to: "/home/#{application}/app",
|
18
|
+
rails_env: 'production',
|
19
|
+
use_sudo: false,
|
20
|
+
rvm_ruby_string: "#{ruby_version}@#{application}",
|
21
|
+
scm: :git,
|
22
|
+
git_shallow_clone: 1,
|
23
|
+
keep_releases: 5,
|
24
|
+
rvm_path: '/usr/local/rvm',
|
25
|
+
rvm_bin_path: '/usr/local/rvm/bin'
|
26
|
+
}.each { |key, value| set key, value }
|
41
27
|
|
42
|
-
|
43
|
-
|
44
|
-
|
28
|
+
role :app, domain
|
29
|
+
role :web, domain
|
30
|
+
role :db, domain, :primary => true
|
31
|
+
|
32
|
+
namespace :deploy do
|
33
|
+
task :start do ; end
|
34
|
+
task :stop do ; end
|
35
|
+
|
36
|
+
task :restart, :roles => :app do
|
37
|
+
run "touch #{current_path}/tmp/restart.txt"
|
38
|
+
end
|
39
|
+
|
40
|
+
task :symlink_shared, :roles => :app do
|
41
|
+
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
|
42
|
+
end
|
43
|
+
|
44
|
+
task :add_revision, :roles => :app do
|
45
|
+
revision = %x{git ls-remote #{repository} #{branch}}
|
46
|
+
run %Q{echo "#{revision}" #{release_path}/REVISION}
|
47
|
+
end
|
45
48
|
end
|
46
|
-
end
|
47
49
|
|
48
|
-
after "bundle:install", "deploy:symlink_shared"
|
49
|
-
after "bundle:install", "deploy:add_revision"
|
50
|
-
after "deploy:update", "deploy:cleanup"
|
50
|
+
after "bundle:install", "deploy:symlink_shared"
|
51
|
+
after "bundle:install", "deploy:add_revision"
|
52
|
+
after "deploy:update", "deploy:cleanup"
|
53
|
+
|
54
|
+
end
|