prun-ops 0.2.18 → 0.3.0

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
  SHA256:
3
- metadata.gz: 5330757b3e8385c1445b0d94e82d02b9f3cb920feea8d8ab171ffb78e6ad701e
4
- data.tar.gz: aa86e7b32848327356988c2a03d033410872ef0071ea6bf9f83d67ba5fab58f6
3
+ metadata.gz: cfe66e0e6eca2984b10e276613767b236a719ed2cdcb92ed51ca3b78062b71ce
4
+ data.tar.gz: 366be3e7998aac88911f68bf8a78a087212055fe240f6c0d662070227eb085b3
5
5
  SHA512:
6
- metadata.gz: 5f2d42e416ed781d1ab60a32b7d71df8e5e4c18cd47b787f9c170362718247a27d7272a2de6d57b3c227252aa468720a6e77804083965531a262a51b4154c003
7
- data.tar.gz: 6b522fa8f34964d9de07cd9275663b36f96ed0b09f03db7cbb54b58e4db112ef7c7cf7e6d7eacc8c6c0f274cf46fe2b1962c746797b28160654e9173b2b73a1e
6
+ metadata.gz: 3b721ff34499c5ec3891a61fa6ae3f2a0bf2fa9fa615cb78d54747b551e1ccedf6f40ef7e405ef36043ee8236f53873104367c50b03b743a59d73a3ba2d4b833
7
+ data.tar.gz: b47621f17dfa836188fa03e022b28767e94b30112082388128363db45f65ceffe4c5f8c8e75131232eb98e941fb0c72cfbc44c9e961d71387d3cccfea77b84ba
data/README.md CHANGED
@@ -35,13 +35,18 @@ Capfile should include these requirements:
35
35
  ```ruby
36
36
  require 'capistrano/setup'
37
37
  require 'capistrano/deploy'
38
+ require "capistrano/rvm"
38
39
  require 'capistrano/rails'
39
40
  require 'capistrano/bundler'
40
41
  require 'capistrano/rails/assets'
41
42
  require 'capistrano/rails/migrations'
43
+ require "capistrano/puma"
44
+ install_plugin Capistrano::Puma # Default puma tasks
45
+ install_plugin Capistrano::Puma::Systemd
42
46
  require "#{File.dirname(__FILE__)}/config/application"
43
47
  require 'capistrano/prun-ops'
44
48
  Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
49
+ Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
45
50
  ```
46
51
 
47
52
  Notice that you are adding all prun-ops tasks with the line `require 'capistrano/prun-ops'`
@@ -49,7 +54,7 @@ Notice that you are adding all prun-ops tasks with the line `require 'capistrano
49
54
  Your config/deploy/production.rb:
50
55
 
51
56
  ```
52
- server "example.com", user: 'root', roles: %w{web app db}, port: 2222
57
+ server "example.com", user: 'root', roles: %w{web app db} # , port: 2222
53
58
  ```
54
59
 
55
60
  Note: Remember change this line in production.rb file: `config.assets.compile = true`
@@ -64,36 +69,41 @@ bastion 'bastion.example.com', user: 'user'
64
69
 
65
70
  Main task is `cap [stg] config`
66
71
 
67
- Secondary tasks:
68
-
69
- * `cap [stg] ubuntu:install` initial ubuntu dependencies
70
- * `cap [stg] ruby:install` install ruby on .ruby-version version
71
- * `cap [stg] rails:prepare` install rails dependencies
72
- * `cap [stg] postgres:install` install and configure postgres
73
- * `cap [stg] postgres:[start|stop|restart]` start/stop postgres
74
- * `cap [stg] nginx:install` install and configure nginx
75
- * `cap [stg] nginx:[start|stop|restart]` start/stop nginx
76
- * `cap [stg] nodejs:install` install node
77
- * `cap [stg] app:prepare` create init scripts
78
- * `cap [stg] app:db_prepare` database first load
79
- * `cap [stg] nginx:cert` create SSL certificates with [Let's Encrypt](https://letsencrypt.org/)
80
- * `cap [stg] nginx:ssl` configure nginx with SSL certificates
81
-
72
+ Secondary tasks:
73
+
74
+ - `cap [stg] ubuntu:prepare` initial ubuntu dependencies
75
+ - `cap [stg] ruby:brightbox`(DEPRECATED) install ruby on .ruby-version version from brightbox
76
+ - `cap [stg] ruby:rvm` install ruby version manager
77
+ - `cap [stg] ruby:install_rvm_project_version` installs ruby version in .ruby-version file of the project
78
+ - `cap [stg] rails:prepare` install rails dependencies
79
+ - `cap [stg] postgres:install` install and configure postgres
80
+ - `cap [stg] postgres:[start|stop|restart]` start/stop postgres
81
+ - `cap [stg] nginx:install` install and configure nginx
82
+ - `cap [stg] nginx:[start|stop|restart]` start/stop nginx
83
+ - `cap [stg] nodejs:install` install node
84
+ - `cap [stg] redis:install` install redis server
85
+ - `cap [stg] app:prepare`(DEPRECATED) create init scripts
86
+ - `cap [stg] app:db_prepare`(DEPRECATED) database first load
87
+ - `cap [stg] nginx:cert` create SSL certificates with [Let's Encrypt](https://letsencrypt.org/)
88
+ - `cap [stg] nginx:ssl` configure nginx with SSL certificates
89
+
90
+ Considerations:
91
+ -
82
92
  ### Deployment
83
93
 
84
94
  Main task is `cap [stg] deploy`
85
95
 
86
- Secondary tasks:
96
+ Secondary tasks:
87
97
 
88
- * `cap [stg] deploy:upload_linked_files` uploads configuration files defined as linked_files
89
- * `cap [stg] deploy` deploy your app as usual
90
- * `cap [stg] deploy:restart` restart thin server of this application
91
- * `cap [stg] deploy:stop` stop thin server
92
- * `cap [stg] deploy:start` start thin server
93
- * `cap [stg] deploy:db_create` create database
94
- * `cap [stg] deploy:db_reset` load schema and seeds for first DB setup
95
- * `cap [stg] deploy:db_seed` seeds the database
96
- * `cap [stg] git:remove_repo` Removes repo (useful when repo_url changes)
98
+ - `cap [stg] deploy:upload_linked_files` uploads configuration files defined as linked_files
99
+ - `cap [stg] deploy` deploy your app as usual
100
+ - `cap [stg] deploy:restart` restart thin server of this application
101
+ - `cap [stg] deploy:stop` stop thin server
102
+ - `cap [stg] deploy:start` start thin server
103
+ - `cap [stg] deploy:db_create` create database
104
+ - `cap [stg] deploy:db_reset` load schema and seeds for first DB setup
105
+ - `cap [stg] deploy:db_seed` seeds the database
106
+ - `cap [stg] git:remove_repo` Removes repo (useful when repo_url changes)
97
107
 
98
108
  Added the possibility of deploying from local repository. Add to `deploy.rb` or `[stg].rb` files:
99
109
 
@@ -103,6 +113,11 @@ before :deploy, "git:deploy_from_local_repo"
103
113
 
104
114
  Take care to remove the previous repo if you are changing the :repo_url : `cap [stg] git:remove_repo`
105
115
 
116
+ ### Trouble shooting
117
+
118
+ * In Rails 7 you have to create a new credentials/staging.key and file for each environment. This is just deleting credentials and runing again EDITOR="vim" rails credentials:edit --staging
119
+
120
+ * If capistrano dos no find any command is the order of .basrc file, [here is well explained](https://stackoverflow.com/questions/25479348/how-can-i-instruct-capistrano-3-to-load-my-shell-environment-variables-set-at-re/29344562#29344562)
106
121
 
107
122
  ### Backup
108
123
 
@@ -119,42 +134,41 @@ Configure your 'config/applciation.rb':
119
134
  ```
120
135
 
121
136
  And
122
- ![backup schema](https://docs.google.com/drawings/d/1Sp8ysn46ldIWRxaLUHfzpu7vK0zMjh4_iMpEP1U6SuU/pub?w=642&h=277 "Backup commands schema")
137
+ ![backup schema](https://docs.google.com/drawings/d/1Sp8ysn46ldIWRxaLUHfzpu7vK0zMjh4_iMpEP1U6SuU/pub?w=642&h=277 "Backup commands schema")
123
138
 
124
- * `cap [stg] pull:data`: downloads DDBB and file folders from the stage you need.
125
- * `cap [stg] pull:db`: Hot backup, download and restore of the stage database
126
- * `cap [stg] pull:files`: Hot restore of backup_files
127
- * `cap [stg] backup[TAG]`: Commit a backup of DDBB and files to the git repo configured. "application-YYYYMMDD" tagged if no tag is provided.
128
- * `cap [stg] backup:restore[TAG]`: Restore the last backup into the stage indicated, or tagged state if TAG is provided.
129
- * `rake backup |TAG|`: Uploads backup to git store from local, tagging with date, or with TAG if provided. Useful to backup production stage.
130
- * `rake backup:restore |TAG|`: Restore last backup copy, or tagged with TAG if provided.
139
+ - `cap [stg] pull:data`: downloads DDBB and file folders from the stage you need.
140
+ - `cap [stg] pull:db`: Hot backup, download and restore of the stage database
141
+ - `cap [stg] pull:files`: Hot restore of backup_files
142
+ - `cap [stg] backup[TAG]`: Commit a backup of DDBB and files to the git repo configured. "application-YYYYMMDD" tagged if no tag is provided.
143
+ - `cap [stg] backup:restore[TAG]`: Restore the last backup into the stage indicated, or tagged state if TAG is provided.
144
+ - `rake backup |TAG|`: Uploads backup to git store from local, tagging with date, or with TAG if provided. Useful to backup production stage.
145
+ - `rake backup:restore |TAG|`: Restore last backup copy, or tagged with TAG if provided.
131
146
 
132
147
  ### TODO: Release
133
148
 
134
149
  Release management
135
150
 
136
- * `rake release |VERSION|` push forward from dev-branch to master-branch and tag the commit with VERSION name.
137
- * `rake release:delete |VERSION|` remove tag with VERSION name.
138
- * `rake git:ff` merge dev branch towards master branch without releasing (Deprecating, new version "rake tomaster[message]")
139
-
140
- ![Release management](https://docs.google.com/drawings/d/1PLIQ8SMagUo1438RNShl99Ux3daFutmRgIsbQqhJ2n4/pub?w=917&h=551 "Release management")
151
+ - `rake release |VERSION|` push forward from dev-branch to master-branch and tag the commit with VERSION name.
152
+ - `rake release:delete |VERSION|` remove tag with VERSION name.
153
+ - `rake git:ff` merge dev branch towards master branch without releasing (Deprecating, new version "rake tomaster[message]")
141
154
 
155
+ ![Release management](https://docs.google.com/drawings/d/1PLIQ8SMagUo1438RNShl99Ux3daFutmRgIsbQqhJ2n4/pub?w=917&h=551 "Release management")
142
156
 
143
157
  ### Diagnosis
144
158
 
145
159
  Some capistrano commands useful to connect to server and help with the problem solving.
146
160
 
147
- * `cap [stg] ssh` open a ssh connection with server
148
- * `cap [stg] log_tail[LOG_FILENAME]` tail all rails logs by default, or only one if LOG_FILENAME is provided
149
- * `cap [stg] log_patter[PATTERN]` search a pattern in all logs
150
- * `cap [stg] c` open a rails console with server
151
- * `cap [stg] dbconsole` open a rails database console with server
152
- * `cap [stg] x[COMMAND]` execute any command in server provided as COMMAND (i.e.: cap production x['free -m'])
153
- * `cap [stg] rake[TASK]` execute any rake task in server provided as TASK (i.e.: cap production rake[db:version])
161
+ - `cap [stg] ssh` open a ssh connection with server
162
+ - `cap [stg] log_tail[LOG_FILENAME]` tail all rails logs by default, or only one if LOG_FILENAME is provided
163
+ - `cap [stg] log_patter[PATTERN]` search a pattern in all logs
164
+ - `cap [stg] c` open a rails console with server
165
+ - `cap [stg] dbconsole` open a rails database console with server
166
+ - `cap [stg] x[COMMAND]` execute any command in server provided as COMMAND (i.e.: cap production x['free -m'])
167
+ - `cap [stg] rake[TASK]` execute any rake task in server provided as TASK (i.e.: cap production rake[db:version])
154
168
 
155
169
  ### Monitoring
156
170
 
157
- At this moment we are implementing [NewRelic](http://newrelic.com/) monitoring, including as dependency ['newrelic_rpm'](https://github.com/newrelic/rpm) gem. To configure yourproject you just need to create an account at [NewRelic](http://newrelic.com/) and follow the instructions (creating a 'config/newrelic.yml file with your license_key).
171
+ At this moment we are implementing [NewRelic](http://newrelic.com/) monitoring, including as dependency ['newrelic_rpm'](https://github.com/newrelic/rpm) gem. To configure yourproject you just need to create an account at [NewRelic](http://newrelic.com/) and follow the instructions (creating a 'config/newrelic.yml file with your license_key).
158
172
 
159
173
  ### TODO: Configuration management
160
174
 
@@ -171,8 +185,6 @@ At this moment we are implementing [NewRelic](http://newrelic.com/) monitoring,
171
185
  `cap [stg] configure:jenkins`
172
186
  `cap [stg] configure:wordpress`
173
187
 
174
-
175
-
176
188
  ## Contributing
177
189
 
178
190
  1. Fork it ( https://github.com/[my-github-username]/prun-ops/fork )
@@ -189,38 +201,38 @@ At this moment we are implementing [NewRelic](http://newrelic.com/) monitoring,
189
201
 
190
202
  ### v0.0.2
191
203
 
192
- * First publication
204
+ - First publication
193
205
 
194
206
  ### v0.0.4
195
207
 
196
- * Changing homepage and License
197
- * start|stop|restart thin server per application as Capistrano task
208
+ - Changing homepage and License
209
+ - start|stop|restart thin server per application as Capistrano task
198
210
 
199
211
  ### v0.0.5
200
212
 
201
- * Removing Application server version (thin 1.6.2) dependency
213
+ - Removing Application server version (thin 1.6.2) dependency
202
214
 
203
215
  ### v0.0.6
204
216
 
205
- * Fixing DigitalOcean images error when slug is nil for client images
206
- * Adding git:ff rake task
217
+ - Fixing DigitalOcean images error when slug is nil for client images
218
+ - Adding git:ff rake task
207
219
 
208
220
  ### v0.0.8
209
221
 
210
- * Adding backup[tag] capistrano task for production
222
+ - Adding backup[tag] capistrano task for production
211
223
 
212
224
  ### v0.0.9
213
225
 
214
- * Fixing Capistrano pulling tasks "pull:data"
226
+ - Fixing Capistrano pulling tasks "pull:data"
215
227
 
216
228
  ### v0.0.10
217
229
 
218
- * Removing bin/ops command in order to create open-dock gem
219
- * Remove prun-ops dependency from 'config/deployment.rb' file and ad it to 'Capfile' as `require 'capistrano/prun-ops'`
230
+ - Removing bin/ops command in order to create open-dock gem
231
+ - Remove prun-ops dependency from 'config/deployment.rb' file and ad it to 'Capfile' as `require 'capistrano/prun-ops'`
220
232
 
221
233
  ### v0.0.21
222
234
 
223
- * Remove from your 'config/deploy.rb':
235
+ - Remove from your 'config/deploy.rb':
224
236
 
225
237
  ```ruby
226
238
  # Backup directories
@@ -240,16 +252,16 @@ require 'capistrano/prun-ops'
240
252
 
241
253
  ### v0.1.2
242
254
 
243
- * Add `cap stage dbconsole` to open a database console.
255
+ - Add `cap stage dbconsole` to open a database console.
244
256
 
245
257
  ### v0.1.6
246
258
 
247
- * Add `cap stage rake[db:create]` to execute a rake task in remote server.
259
+ - Add `cap stage rake[db:create]` to execute a rake task in remote server.
248
260
 
249
261
  ### v0.2.0
250
262
 
251
- * Configuration tasks: Add `cap stage config` and other tasks.
263
+ - Configuration tasks: Add `cap stage config` and other tasks.
252
264
 
253
265
  ### v0.2.8
254
266
 
255
- * Bastion command
267
+ - Bastion command
@@ -27,14 +27,14 @@ namespace :deploy do
27
27
  end
28
28
 
29
29
  after :publishing, :upload_linked_files
30
- after :publishing, :restart
30
+ # after :publishing, :restart
31
31
 
32
32
  desc 'Create database'
33
33
  task :db_create do
34
34
  on roles(:db) do
35
35
  within release_path do
36
36
  with rails_env: fetch(:stage) do
37
- execute :rake, 'db:create'
37
+ execute :rails, 'db:create'
38
38
  end
39
39
  end
40
40
  end
@@ -44,7 +44,7 @@ namespace :deploy do
44
44
  on roles(:db) do
45
45
  within release_path do
46
46
  with rails_env: fetch(:stage) do
47
- execute :rake, 'db:drop'
47
+ execute :rails, 'db:drop'
48
48
  end
49
49
  end
50
50
  end
@@ -54,8 +54,8 @@ namespace :deploy do
54
54
  on roles(:db) do
55
55
  within release_path do
56
56
  with rails_env: fetch(:stage) do
57
- execute :rake, 'db:schema:load'
58
- execute :rake, 'db:seed'
57
+ execute :rails, 'db:schema:load'
58
+ execute :rails, 'db:seed'
59
59
  end
60
60
  end
61
61
  end
@@ -65,7 +65,7 @@ namespace :deploy do
65
65
  on roles(:db) do
66
66
  within release_path do
67
67
  with rails_env: fetch(:stage) do
68
- execute :rake, 'db:seed'
68
+ execute :rails, 'db:seed'
69
69
  end
70
70
  end
71
71
  end
@@ -1,7 +1,7 @@
1
1
  namespace :nginx do
2
2
  task :install do
3
3
  on roles :web, :api do
4
- execute 'sudo apt-get install -y nginx'
4
+ execute "#{apt_nointeractive} nginx"
5
5
  execute 'sudo sed -i "s/# server_names_hash_bucket_size 64/server_names_hash_bucket_size 64/" /etc/nginx/nginx.conf'
6
6
  template 'vhost.conf', '/etc/nginx/conf.d/vhost.conf'
7
7
 
@@ -7,7 +7,7 @@ namespace :nodejs do
7
7
  export NVM_DIR="$HOME/.nvm"
8
8
  [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
9
9
  nvm install node
10
- npm install -g bower
10
+ npm install --global yarn
11
11
  EOBLOCK
12
12
  end
13
13
  end
@@ -9,17 +9,17 @@ namespace :postgres do
9
9
 
10
10
  on roles :all do
11
11
  execute <<-EOBLOCK
12
- sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main"
12
+ sudo add-apt-repository -y "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main"
13
13
  wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
14
14
  sudo apt-get update
15
15
  sudo export LANGUAGE=en_US.UTF-8
16
- sudo apt-get -y install postgresql-client-#{version} libpq-dev
16
+ #{apt_nointeractive} postgresql-client-#{version} libpq-dev
17
17
  EOBLOCK
18
18
  end
19
19
 
20
20
  on roles :db do
21
21
  execute <<-EOBLOCK
22
- sudo apt-get -y install postgresql-#{version} libpq-dev
22
+ #{apt_nointeractive} postgresql-#{version} libpq-dev
23
23
  EOBLOCK
24
24
 
25
25
  execute <<-EOBLOCK
@@ -32,7 +32,7 @@ namespace :postgres do
32
32
 
33
33
  ## Rewrite postgres password:
34
34
  execute <<-EOBLOCK
35
- sudo -u postgres psql -c "ALTER USER #{username} WITH PASSWORD '#{password}';"
35
+ sudo -u postgres psql -c "CREATE USER #{username} WITH PASSWORD '#{password}';"
36
36
  EOBLOCK
37
37
  execute <<-EOBLOCK
38
38
  sudo -u postgres psql -c "create database #{database};"
@@ -2,14 +2,12 @@ namespace :rails do
2
2
  task :prepare do
3
3
  on roles :all do
4
4
  execute <<-EOBLOCK
5
+ source "/etc/profile.d/rvm.sh"
5
6
  echo gem: --no-ri --no-rdoc | sudo tee -a /etc/gemrc
6
- sudo gem install bundler
7
- sudo gem install rack -v 1.6.0
8
- sudo gem install thin -v 1.6.3
9
- sudo thin install
10
- sudo /usr/sbin/update-rc.d -f thin defaults
7
+ gem install bundler
8
+ gem install rack #-v 1.6.0
11
9
  EOBLOCK
12
- execute 'sudo apt-get install -y imagemagick libmagickwand-dev'
10
+ execute "#{apt_nointeractive} imagemagick libmagickwand-dev"
13
11
 
14
12
  execute <<-EOBLOCK
15
13
  sudo mkdir -p /var/www/#{fetch :application}
@@ -0,0 +1,12 @@
1
+ namespace :redis do
2
+ task :install do
3
+ on roles :app do
4
+ execute <<-EOBLOCK
5
+ curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
6
+ echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
7
+ sudo apt-get update
8
+ #{apt_nointeractive} redis
9
+ EOBLOCK
10
+ end
11
+ end
12
+ end
@@ -1,12 +1,34 @@
1
1
  namespace :ruby do
2
- task :install do
2
+ task :brightbox do
3
3
  ruby_version = File.read('.ruby-version').strip[/\Aruby-(.*)\.\d\Z/,1]
4
4
  on roles :all do
5
5
  execute <<-EOBLOCK
6
6
  sudo apt-add-repository -y ppa:brightbox/ruby-ng
7
7
  sudo apt-get update
8
- sudo apt-get install -y ruby#{ruby_version} ruby#{ruby_version}-dev
8
+ #{apt_nointeractive} ruby#{ruby_version} ruby#{ruby_version}-dev
9
9
  EOBLOCK
10
10
  end
11
11
  end
12
+ task :rvm do
13
+ on roles :all do
14
+ execute <<-EOBLOCK
15
+ sudo apt-add-repository -y ppa:rael-gc/rvm
16
+ sudo apt-get update
17
+ #{apt_nointeractive} rvm
18
+ sudo usermod -a -G rvm $USER
19
+ EOBLOCK
20
+ end
21
+ end
22
+ task :install_rvm_project_version do
23
+ ruby_version = File.read('.ruby-version').strip
24
+
25
+ on roles :all do
26
+ execute <<-EOBLOCK
27
+ source "/etc/profile.d/rvm.sh"
28
+ rvm install ruby-#{ruby_version}
29
+ rvm --default use ruby-#{ruby_version}
30
+ EOBLOCK
31
+ end
32
+ end
33
+
12
34
  end
@@ -1,15 +1,16 @@
1
1
  namespace :ubuntu do
2
- task :install do
2
+ task :prepare do
3
3
  on roles :all do
4
4
  execute 'sudo apt-get -y update'
5
5
  # Pre-requirements
6
6
  execute <<-EOBLOCK
7
- sudo apt-get install -y git build-essential libsqlite3-dev libssl-dev gawk g++ vim
8
- sudo apt-get install -y libreadline6-dev libyaml-dev sqlite3 autoconf libgdbm-dev
9
- sudo apt-get install -y libcurl3 libcurl3-gnutls libcurl4-openssl-dev
10
- sudo apt-get install -y libncurses5-dev automake libtool bison pkg-config libffi-dev
11
- sudo apt-get install -y software-properties-common
7
+ #{apt_nointeractive} git build-essential libsqlite3-dev libssl-dev gawk g++ vim
8
+ #{apt_nointeractive} libssl-dev libreadline-dev libgdbm-dev openssl
9
+ #{apt_nointeractive} libreadline6-dev libyaml-dev sqlite3 autoconf libgdbm-dev
10
+ #{apt_nointeractive} libcurl4 libcurl3-gnutls libcurl4-openssl-dev
11
+ #{apt_nointeractive} libncurses5-dev automake libtool bison pkg-config libffi-dev
12
+ #{apt_nointeractive} software-properties-common gnupg2
12
13
  EOBLOCK
13
14
  end
14
15
  end
15
- end
16
+ end
@@ -29,14 +29,14 @@ desc 'Tails the environment log or the log passed as argument: cap log_tail[thin
29
29
  task :log_tail, :file do |task, args|
30
30
  on roles(:app) do
31
31
  file = args[:file]? args[:file] : "*"
32
- execute "tail -f #{shared_path}/log/#{file} | grep -vE \"(^\s*$|asset|Render)\""
32
+ execute "tail -f #{current_path}/log/#{file} | grep -vE \"(^\s*$|asset|Render)\""
33
33
  end
34
34
  end
35
35
 
36
36
  desc 'Search for a pattern in logs'
37
37
  task :log_pattern, :pattern do |task, args|
38
38
  on roles(:app) do
39
- execute "cat #{shared_path}/log/* | grep -A 10 -B 5 '#{args[:pattern]}'"
39
+ execute "cat #{current_path}/log/* | grep -A 10 -B 5 '#{args[:pattern]}'"
40
40
  end
41
41
  end
42
42
 
@@ -22,4 +22,8 @@ def bastion(host, user:)
22
22
  require 'net/ssh/proxy/command'
23
23
  ssh_command = "ssh -W %h:%p -o StrictHostKeyChecking=no #{user}@#{host}"
24
24
  set :ssh_options, proxy: Net::SSH::Proxy::Command.new(ssh_command)
25
+ end
26
+
27
+ def apt_nointeractive
28
+ 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y'
25
29
  end
@@ -1,3 +1,3 @@
1
1
  module PrunOps
2
- VERSION = "0.2.18"
2
+ VERSION = "0.3.0"
3
3
  end
data/prun-ops.gemspec CHANGED
@@ -17,11 +17,13 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_development_dependency "bundler", "~> 1.6"
21
- spec.add_development_dependency "rake", "~> 10.0"
20
+ spec.add_development_dependency "bundler"
21
+ spec.add_development_dependency "rake"
22
22
 
23
- spec.add_runtime_dependency 'capistrano', '~> 3.8'
23
+ spec.add_runtime_dependency 'capistrano'
24
24
  spec.add_runtime_dependency 'capistrano-rails'
25
+ spec.add_runtime_dependency 'capistrano-rvm'
26
+ spec.add_runtime_dependency 'capistrano3-puma'
25
27
  spec.add_runtime_dependency 'thin'
26
28
  spec.add_runtime_dependency 'newrelic_rpm'
27
29
  end
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prun-ops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.18
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Lebrijo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-15 00:00:00.000000000 Z
11
+ date: 2023-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.6'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.6'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: capistrano
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '3.8'
47
+ version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '3.8'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: capistrano-rails
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +66,34 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: capistrano-rvm
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: capistrano3-puma
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: thin
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -118,6 +146,7 @@ files:
118
146
  - lib/capistrano/config/nodejs.rake
119
147
  - lib/capistrano/config/postgres.rake
120
148
  - lib/capistrano/config/rails.rake
149
+ - lib/capistrano/config/redis.rake
121
150
  - lib/capistrano/config/ruby.rake
122
151
  - lib/capistrano/config/templates/app_init.sh.erb
123
152
  - lib/capistrano/config/templates/vhost.conf.erb