capistrano-node-deploy 1.0.5 → 1.0.6

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/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.5
1
+ 1.0.6
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "capistrano-node-deploy"
8
- s.version = "1.0.5"
8
+ s.version = "1.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["James Smith"]
@@ -23,7 +23,7 @@ end
23
23
 
24
24
  Capistrano::Configuration.instance(:must_exist).load do |configuration|
25
25
  before "deploy", "deploy:create_release_dir"
26
- before "deploy", "node:create_upstart_config"
26
+ before "deploy", "node:check_upstart_config"
27
27
  after "deploy:symlink", "node:install_packages"
28
28
  after "deploy:symlink", "node:restart"
29
29
 
@@ -42,19 +42,21 @@ Capistrano::Configuration.instance(:must_exist).load do |configuration|
42
42
  run "ln -s #{shared_path}/node_modules #{current_path}/node_modules"
43
43
  end
44
44
 
45
+ task :check_upstart_config do
46
+ create_upstart_config unless remote_file_exists?("/etc/init/#{application}.conf")
47
+ end
48
+
45
49
  desc "Create upstart script for this node app"
46
50
  task :create_upstart_config do
47
51
  config_file_path = "/etc/init/#{application}.conf"
48
- unless remote_file_exists?(config_file_path)
49
- temp_config_file_path = "#{shared_path}/#{application}.conf"
52
+ temp_config_file_path = "#{shared_path}/#{application}.conf"
50
53
 
51
- # Generate and upload the upstart script
52
- put UPSTART_TEMPLATE.gsub(/\{\{(.*?)\}\}/) { eval($1) }, temp_config_file_path
54
+ # Generate and upload the upstart script
55
+ put UPSTART_TEMPLATE.gsub(/\{\{(.*?)\}\}/) { eval($1) }, temp_config_file_path
53
56
 
54
- # Copy the script into place and make executable
55
- sudo "cp #{temp_config_file_path} #{config_file_path}"
56
- sudo "chmod +x #{config_file_path}"
57
- end
57
+ # Copy the script into place and make executable
58
+ sudo "cp #{temp_config_file_path} #{config_file_path}"
59
+ sudo "chmod +x #{config_file_path}"
58
60
  end
59
61
 
60
62
  desc "Start the node application"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-node-deploy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 5
10
- version: 1.0.5
9
+ - 6
10
+ version: 1.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - James Smith