capistrano-demo 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/capistrano-demo.gemspec +1 -1
- data/lib/capistrano/demo.rb +2 -4
- data/lib/capistrano/tasks/demo.rake +3 -8
- data/lib/capistrano/tasks/setup.rake +12 -7
- data/lib/capistrano/tasks/utils.rake +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 394d4fece2a21a14144b396e67b50a5517d39efc
|
4
|
+
data.tar.gz: c9d29a960a8eabb5fccb8bfa14c617f58accb330
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f2927e996173a06a957df654c0d927ee659421d3c76435b54000d393e0a66e5e9709ad995d872af968c5a12252eeb7e07a16d53135f310ab6afdaed85456f2a
|
7
|
+
data.tar.gz: 8fc4bb461555fd91b8feb808523efdf47651e9e2843dea019fea0d69963a0aa4cc195a30796c9aced54f6e4690707f5045e2e741d01b512c51a9edfd3dee7c79
|
data/capistrano-demo.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = 'capistrano-demo'
|
6
|
-
spec.version = '0.0.
|
6
|
+
spec.version = '0.0.7'
|
7
7
|
spec.authors = ['Arthur Shcheglov (fc_arny)']
|
8
8
|
spec.email = ['arthur.shcheglov@gmail.com']
|
9
9
|
spec.summary = %q{Create demo-host by branch name}
|
data/lib/capistrano/demo.rb
CHANGED
@@ -17,12 +17,10 @@ def demo_url
|
|
17
17
|
format("%s.%s", demo_branch, demo_host)
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
20
|
+
def demo_path
|
21
21
|
deploy_path.join('demo', demo_branch)
|
22
22
|
end
|
23
23
|
|
24
24
|
def demo_default_db
|
25
25
|
format("%s_%s", fetch(:application), fetch(:stage))
|
26
|
-
end
|
27
|
-
|
28
|
-
|
26
|
+
end
|
@@ -5,7 +5,7 @@ namespace :load do
|
|
5
5
|
set :demo_branch, demo_branch
|
6
6
|
|
7
7
|
set :demo_db, -> { demo_default_db }
|
8
|
-
set :
|
8
|
+
set :demo_path, -> { demo_path }
|
9
9
|
|
10
10
|
set :demo_host, -> { fetch(:application) }
|
11
11
|
|
@@ -21,10 +21,6 @@ end
|
|
21
21
|
|
22
22
|
|
23
23
|
namespace :demo do
|
24
|
-
task :test do
|
25
|
-
puts "* Demo host created => http://visp-666.32team.com *".colorize(:light_green).blink
|
26
|
-
end
|
27
|
-
|
28
24
|
desc 'Chain of task for creating demo-host'
|
29
25
|
task :create do
|
30
26
|
%w{code configs gems db assets}.each do |task|
|
@@ -33,8 +29,7 @@ namespace :demo do
|
|
33
29
|
|
34
30
|
invoke 'demo:restart'
|
35
31
|
|
36
|
-
|
37
|
-
puts '*' * msg.length, msg, '*' * msg.length
|
32
|
+
puts "------> Demo host created: http://#{demo_url}".colorize(:light_green)
|
38
33
|
end
|
39
34
|
|
40
35
|
desc 'Destroy demo-host'
|
@@ -46,7 +41,7 @@ namespace :demo do
|
|
46
41
|
execute :rm, entry[:link]
|
47
42
|
end
|
48
43
|
|
49
|
-
execute :rm, '-rf', fetch(:
|
44
|
+
execute :rm, '-rf', fetch(:demo_path)
|
50
45
|
end
|
51
46
|
end
|
52
47
|
|
@@ -4,7 +4,12 @@ namespace :demo do
|
|
4
4
|
task :bootstrap do
|
5
5
|
set :demo_branch, ask('branch name', fetch(:demo_branch, demo_branch))
|
6
6
|
set :demo_db, ask('database name', fetch(:demo_db, demo_default_db))
|
7
|
-
set :release_path,
|
7
|
+
set :release_path, demo_path
|
8
|
+
|
9
|
+
puts '*' * 500
|
10
|
+
def current_path
|
11
|
+
deploy_path.join('demo', demo_branch)
|
12
|
+
end
|
8
13
|
end
|
9
14
|
|
10
15
|
# desc 'Fetch code from repo\'s branch'
|
@@ -13,12 +18,12 @@ namespace :demo do
|
|
13
18
|
|
14
19
|
on roles(fetch(:demo_role)) do
|
15
20
|
# Create dir for demo-host
|
16
|
-
execute :mkdir, "-p #{fetch(:
|
21
|
+
execute :mkdir, "-p #{fetch(:demo_path)}"
|
17
22
|
|
18
23
|
# Upload code
|
19
24
|
with fetch(:git_environmental_variables) do
|
20
25
|
within repo_path do
|
21
|
-
set :release_path, fetch(:
|
26
|
+
set :release_path, fetch(:demo_path)
|
22
27
|
strategy.update
|
23
28
|
strategy.release
|
24
29
|
end
|
@@ -31,7 +36,7 @@ namespace :demo do
|
|
31
36
|
|
32
37
|
# desc 'Install gems'
|
33
38
|
task :gems => [:bootstrap] do
|
34
|
-
set :bundle_gemfile,
|
39
|
+
set :bundle_gemfile, demo_path.join('Gemfile')
|
35
40
|
|
36
41
|
on roles(fetch(:demo_role)) do
|
37
42
|
invoke 'bundler:install'
|
@@ -41,7 +46,7 @@ namespace :demo do
|
|
41
46
|
desc 'Setting database name and run migration'
|
42
47
|
task :db => [:code, :configs] do
|
43
48
|
on roles(fetch(:demo_role)) do
|
44
|
-
within fetch(:
|
49
|
+
within fetch(:demo_path) do
|
45
50
|
with rails_env: fetch(:rails_env) do
|
46
51
|
# if fetch(:create_db).downcase == 'y'
|
47
52
|
# info '[Re]Creating database'
|
@@ -62,7 +67,7 @@ namespace :demo do
|
|
62
67
|
next if fetch(:demo_templates_dir).nil?
|
63
68
|
|
64
69
|
on roles(fetch(:demo_role)) do
|
65
|
-
within fetch(:
|
70
|
+
within fetch(:demo_path) do
|
66
71
|
fetch(:demo_templates_entries).each do |entry|
|
67
72
|
upload! StringIO.new(ERB.new(File.read(fetch(:demo_templates_dir) + entry[:template])).result(binding)), entry[:file]
|
68
73
|
|
@@ -82,7 +87,7 @@ namespace :demo do
|
|
82
87
|
desc 'Precompile assets for demo host'
|
83
88
|
task :assets => [:code] do
|
84
89
|
on roles(fetch(:demo_role)) do
|
85
|
-
within fetch(:
|
90
|
+
within fetch(:demo_path) do
|
86
91
|
with rails_env: fetch(:rails_env) do
|
87
92
|
execute :rake, 'assets:precompile'
|
88
93
|
end
|
@@ -3,9 +3,9 @@ namespace :demo do
|
|
3
3
|
# desc 'Create symlink to file'
|
4
4
|
# task :link_data do
|
5
5
|
# on roles(fetch(:demo_role)) do
|
6
|
-
# within fetch(:
|
6
|
+
# within fetch(:demo_path) do
|
7
7
|
# source = fetch(:demo_db)
|
8
|
-
# target = fetch(:
|
8
|
+
# target = fetch(:demo_path).join('db', 'data.yml')
|
9
9
|
#
|
10
10
|
#
|
11
11
|
# unless test "[ -L #{target} ]"
|
@@ -24,7 +24,7 @@ namespace :demo do
|
|
24
24
|
on roles(fetch(:demo_role)) do
|
25
25
|
|
26
26
|
fetch(:demo_linked_dirs).each do |dir|
|
27
|
-
target = fetch(:
|
27
|
+
target = fetch(:demo_path).join(dir)
|
28
28
|
source = shared_path.join(dir)
|
29
29
|
|
30
30
|
unless test "[ -L #{target} ]"
|
@@ -44,7 +44,7 @@ namespace :demo do
|
|
44
44
|
on roles(fetch(:demo_role)) do
|
45
45
|
fetch(:demo_copied_dirs).each do |dir|
|
46
46
|
source = shared_path.join(dir)
|
47
|
-
target = fetch(:
|
47
|
+
target = fetch(:demo_path).join(dir)
|
48
48
|
|
49
49
|
execute :mkdir, '-p', target
|
50
50
|
execute :cp, '-an', "#{source}/. #{target}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-demo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arthur Shcheglov (fc_arny)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|