capistrano-unformatt 2.3 → 2.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0563c13a45199470fcc48497c1d3568f374d2a2b
4
- data.tar.gz: 2c042fa978d46d1b2985f7d0079ca70f68925e49
2
+ SHA256:
3
+ metadata.gz: cf7394ab6d227ffc9e5679391c7593d71ec765670f66688b6bdec47f2efdd2dc
4
+ data.tar.gz: 276f9fd7678661ef898f7988f998f9486fdce1fe23eca217eb0753b4973df26e
5
5
  SHA512:
6
- metadata.gz: d366eeae63fcc75766c72cc1df37124d286599bc975cef2f86afe63ba1283af3711dcbf4fe97ac04672711a50a125439e360b8a2377e5e3bb617d0b67d281503
7
- data.tar.gz: b9bc951f2083a99794b95ee4063acdc96fc30c0465e8c522b5ff6de5b262a550a1c0b75bf6d2356d7c644e60b982b5123d27068872ba0937b3500053baf3c5a3
6
+ metadata.gz: edfbb6d213debdb43b2d05ea23e7fdef3e91d899b8389b6be1013de2b8e7ded59ac69f7e40927625bbc77685eafdc46a64d0c84d38f4c0c036079c962c5dae02
7
+ data.tar.gz: 68b8a40c28dc139dd3ea18fefdb922cc616518f9d8122951500d3449205d6f52f93aae1d85e0439526fe23ef97d99af53e945f5c54e3630f670ce4932e09ed37
data/CHANGELOG.md CHANGED
@@ -109,3 +109,7 @@
109
109
  ## v2.3
110
110
 
111
111
  * Improved documentation on daemons
112
+
113
+ ## v2.4
114
+
115
+ * Fixes on method to install all
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "capistrano-unformatt"
7
- spec.version = '2.3'
7
+ spec.version = '2.4'
8
8
  spec.authors = ["unformatt"]
9
9
  spec.email = ["unformatt@gmail.com"]
10
10
  spec.description = "Custom recipes for Unformatt projects"
@@ -14,7 +14,7 @@ namespace :deploy do
14
14
  end
15
15
  end
16
16
 
17
- desc "Starts puma"
17
+ desc "Restarts puma"
18
18
  task :restart do
19
19
  on roles :app do
20
20
  execute "#{fetch(:daemons_path)}/#{fetch(:application)}-puma restart"
@@ -57,16 +57,16 @@ namespace :deploy do
57
57
  task :all do
58
58
  unless ENV['SKIP_YAMLS'] == 'true'
59
59
  yaml_names_param = fetch(:setup_yamls, []).map { |x| x.to_s }.join('/')
60
- invoke "deploy:install:yaml[#{yaml_names_param}]"
60
+ invoke 'deploy:install:yaml', yaml_names_param
61
61
  end
62
62
 
63
63
  unless ENV['SKIP_DAEMONS'] == 'true'
64
64
  daemon_names_param = fetch(:setup_daemons, []).map { |x| x[:name].to_s }.join('/')
65
- invoke "deploy:install:daemon[#{daemon_names_param}]"
65
+ invoke 'deploy:install:daemon', daemon_names_param
66
66
  end
67
67
 
68
68
  if fetch(:setup_nginx, false) == true
69
- invoke "deploy:install:nginx"
69
+ invoke 'deploy:install:nginx'
70
70
  end
71
71
  end
72
72
  end
@@ -14,7 +14,7 @@ namespace :deploy do
14
14
  end
15
15
  end
16
16
 
17
- desc "Starts sunspot"
17
+ desc "Restarts sunspot"
18
18
  task :restart do
19
19
  on roles :app do
20
20
  execute "#{fetch(:daemons_path)}/#{fetch(:application)}-sunspot restart"
@@ -14,7 +14,7 @@ namespace :deploy do
14
14
  end
15
15
  end
16
16
 
17
- desc "Starts unicorn"
17
+ desc "Restarts unicorn"
18
18
  task :restart do
19
19
  on roles :app do
20
20
  execute "#{fetch(:daemons_path)}/#{fetch(:application)}-unicorn restart"
@@ -0,0 +1,73 @@
1
+ #!/bin/bash
2
+
3
+ # <%= "Start or stop #{fetch(:application)}-custom_service" %>
4
+ #
5
+ # <%= fetch(:daemon_author_name) %>
6
+
7
+ ### BEGIN INIT INFO
8
+ # Provides: <%= "#{fetch(:application)}-custom_service" %>
9
+ # Required-Start: $local_fs $remote_fs $syslog $network
10
+ # Required-Stop: $local_fs $remote_fs $syslog $network
11
+ # Should-Start:
12
+ # Should-Stop:
13
+ # Default-Start: 2 3 4 5
14
+ # Default-Stop: 0 1 6
15
+ # Short-Description: <%= "Starts #{fetch(:application)}-custom_service" %>
16
+ # Description: <%= "Launches #{fetch(:application)}-custom_service" %>
17
+ ### END INIT INFO
18
+
19
+ PATH=/home/<%=fetch(:monit_user)%>/.rbenv/shims:/home/<%=fetch(:monit_user)%>/.rbenv/bin:$PATH
20
+ PIDFILE=<%= "#{shared_path}/pids/custom_service.pid" %>
21
+ export RAILS_ENV=production
22
+
23
+ getPID() {
24
+ if [ ! -z `cat $PIDFILE 2> /dev/null` ]; then
25
+ if [[ ! -z $(ps -ef | grep -w `cat $PIDFILE` | grep custom_service | grep -v grep) ]]; then
26
+ echo `cat $PIDFILE 2> /dev/null`
27
+ fi
28
+ fi
29
+ }
30
+
31
+ case "$1" in
32
+ start)
33
+ echo -ne "<%= "Starting #{fetch(:application)}-custom_service..." %>"
34
+
35
+ if [ -z "$(getPID)" ]; then
36
+ cd <%=current_path%>
37
+ nohup bundle exec rake custom_service:start &> /dev/null &
38
+
39
+ echo "started!"
40
+ else
41
+ echo "is already running!"
42
+ fi
43
+ ;;
44
+
45
+ stop)
46
+ echo -ne "<%= "Stopping #{fetch(:application)}-custom_service..." %>"
47
+
48
+ if [ -z "$(getPID)" ]; then
49
+ echo "is not running!"
50
+ else
51
+ cd <%=current_path%>
52
+ kill -TERM $(getPID) &> /dev/null
53
+
54
+ echo "stopped!"
55
+ fi
56
+ ;;
57
+
58
+ restart)
59
+ $0 stop
60
+ sleep 3
61
+ $0 start
62
+ ;;
63
+
64
+ check_pid)
65
+ if [ -z "$(getPID)" ]; then
66
+ > $PIDFILE
67
+ fi
68
+ ;;
69
+
70
+ *)
71
+ echo "usage: $0 {start|stop|restart|check_pid}"
72
+ esac
73
+ exit 0
@@ -62,7 +62,7 @@ case "$1" in
62
62
  ;;
63
63
 
64
64
  reload)
65
- echo -ne "<%= "Reloading #{fetch(:application)}puma..." %>"
65
+ echo -ne "<%= "Reloading #{fetch(:application)}-puma..." %>"
66
66
 
67
67
  if [ -z "$(getPID)" ]; then
68
68
  echo "is not running!"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-unformatt
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.3'
4
+ version: '2.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - unformatt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-01 00:00:00.000000000 Z
11
+ date: 2018-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -72,6 +72,7 @@ files:
72
72
  - lib/capistrano/unformatt/sidekiq.rb
73
73
  - lib/capistrano/unformatt/sunspot.rb
74
74
  - lib/capistrano/unformatt/unicorn.rb
75
+ - vendor/templates/custom_service.daemon.erb
75
76
  - vendor/templates/logrotate.conf.erb
76
77
  - vendor/templates/nginx.conf.erb
77
78
  - vendor/templates/puma.daemon.erb
@@ -104,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
105
  version: '0'
105
106
  requirements: []
106
107
  rubyforge_project:
107
- rubygems_version: 2.6.13
108
+ rubygems_version: 2.7.6
108
109
  signing_key:
109
110
  specification_version: 4
110
111
  summary: Custom recipes for Unformatt projects