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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b2db77d9d2f2b9366d65b0ad66c6ad2bc6c7fde
4
- data.tar.gz: bd1b74ba7c2e27940286281c06b3bb4baa744598
3
+ metadata.gz: 394d4fece2a21a14144b396e67b50a5517d39efc
4
+ data.tar.gz: c9d29a960a8eabb5fccb8bfa14c617f58accb330
5
5
  SHA512:
6
- metadata.gz: 0970b6a7d3ae13250d30c158f3b1b91f750a6150900fe05d1b4f4b27e12ff6e2f23823d08d1d27c623228f1b6955f0ebaa427dadf69eaae41ee633f1fa451bac
7
- data.tar.gz: b027a1bc79786dc97484bdd46375a2a7b0cb5bb2b30cff474968ec478b8c826b9737225d02a8451fbe4908cf7adb049bea149b59de4e57fb5214ff3cd7e49a6a
6
+ metadata.gz: 3f2927e996173a06a957df654c0d927ee659421d3c76435b54000d393e0a66e5e9709ad995d872af968c5a12252eeb7e07a16d53135f310ab6afdaed85456f2a
7
+ data.tar.gz: 8fc4bb461555fd91b8feb808523efdf47651e9e2843dea019fea0d69963a0aa4cc195a30796c9aced54f6e4690707f5045e2e741d01b512c51a9edfd3dee7c79
@@ -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'
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}
@@ -17,12 +17,10 @@ def demo_url
17
17
  format("%s.%s", demo_branch, demo_host)
18
18
  end
19
19
 
20
- def demo_dir
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 :demo_dir, -> { demo_dir }
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
- msg = "* Demo host created => http://#{demo_url}".colorize(:light_green)
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(:demo_dir)
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, demo_dir
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(:demo_dir)}"
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(:demo_dir)
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, demo_dir.join('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(:demo_dir) do
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(:demo_dir) do
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(:demo_dir) do
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(:demo_dir) do
6
+ # within fetch(:demo_path) do
7
7
  # source = fetch(:demo_db)
8
- # target = fetch(:demo_dir).join('db', 'data.yml')
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(:demo_dir).join(dir)
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(:demo_dir).join(dir)
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.6
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-07-30 00:00:00.000000000 Z
11
+ date: 2015-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano