uniq-deploy 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/uniq-deploy.rb +50 -0
- metadata +46 -0
data/lib/uniq-deploy.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
# ==============================================
|
4
|
+
# universal web app UNIQ Systems deployment part
|
5
|
+
# ==============================================
|
6
|
+
require 'rvm/capistrano'
|
7
|
+
require 'bundler/capistrano'
|
8
|
+
require 'capistrano_colors'
|
9
|
+
load "deploy/assets"
|
10
|
+
|
11
|
+
# common variables
|
12
|
+
{
|
13
|
+
repository: "git@red:#{application}.git",
|
14
|
+
domain: "#{application}@production-192",
|
15
|
+
deploy_to: "/home/#{application}/app",
|
16
|
+
rails_env: 'production',
|
17
|
+
use_sudo: false,
|
18
|
+
rvm_ruby_string: "#{ruby_version}@#{application}",
|
19
|
+
scm: :git,
|
20
|
+
git_shallow_clone: 1,
|
21
|
+
keep_releases: 5,
|
22
|
+
rvm_path: '/usr/local/rvm',
|
23
|
+
rvm_bin_path: '/usr/local/rvm/bin'
|
24
|
+
}.each { |key, value| set key, value }
|
25
|
+
|
26
|
+
role :app, domain
|
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
|
41
|
+
|
42
|
+
task :add_revision, :roles => :app do
|
43
|
+
revision = %x{git ls-remote #{repository} #{branch}}
|
44
|
+
run %Q{echo "#{revision}" #{release_path}/REVISION}
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
after "bundle:install", "deploy:symlink_shared"
|
49
|
+
after "bundle:install", "deploy:add_revision"
|
50
|
+
after "deploy:update", "deploy:cleanup"
|
metadata
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: uniq-deploy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Ivan Kasatenko
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-07-25 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Common part of the UNIQ Systems deploment process
|
15
|
+
email:
|
16
|
+
- sky@uniqsystems.ru
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- lib/uniq-deploy.rb
|
22
|
+
homepage: http://github.com/SkyWriter/uniq-deploy
|
23
|
+
licenses: []
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 1.3.6
|
40
|
+
requirements: []
|
41
|
+
rubyforge_project:
|
42
|
+
rubygems_version: 1.8.24
|
43
|
+
signing_key:
|
44
|
+
specification_version: 3
|
45
|
+
summary: Common part of the UNIQ Systems deploment process
|
46
|
+
test_files: []
|