orats 0.6.2 → 0.6.3
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 +4 -4
- data/README.md +2 -2
- data/lib/orats/cli.rb +5 -2
- data/lib/orats/commands/new/ansible.rb +1 -8
- data/lib/orats/commands/new/exec.rb +4 -3
- data/lib/orats/commands/new/rails.rb +2 -4
- data/lib/orats/commands/new/{foreman.rb → server.rb} +3 -3
- data/lib/orats/commands/nuke.rb +15 -1
- data/lib/orats/templates/base.rb +150 -100
- data/lib/orats/templates/includes/Galaxyfile +2 -2
- data/lib/orats/templates/includes/Gemfile +4 -4
- data/lib/orats/templates/includes/app/assets/favicon/favicon_base.png +0 -0
- data/lib/orats/templates/includes/inventory/group_vars/all.yml +6 -2
- data/lib/orats/version.rb +1 -1
- data/test/test_helper.rb +3 -3
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84783844b3e3057b3d2954896e9cbeede3be6194
|
4
|
+
data.tar.gz: a7e7d5a60229a20cc69010bcaf1d0633c96f9f2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3b070ff1ebbd3ba5e1a32e04b07c3c6762bf6fa4163c09db19dc475a2d8a91a8ad1c7d4da5f6278347366a0e79991091be70dddb493baee8365671970f7c060
|
7
|
+
data.tar.gz: 29bd81f9ef9dc0ebfee71c717f654270e2869e1678827975ea93fedc842c10feec0730c2a5556c19ebfc3a98778ce7494508bd2847878ca2546dbe706b314e0f
|
data/README.md
CHANGED
@@ -75,7 +75,7 @@ running `orats <command name> help` from your terminal. You can also type `orats
|
|
75
75
|
- Optionally takes: `--template []`
|
76
76
|
- Project features:
|
77
77
|
- Optionally takes: `--skip-extras [false]`
|
78
|
-
- Optionally takes: `--skip-
|
78
|
+
- Optionally takes: `--skip-server-start [false]`
|
79
79
|
- Ansible features:
|
80
80
|
- Optionally takes: `--sudo-password []`
|
81
81
|
- Optionally takes: `--skip-galaxy [false]`
|
@@ -134,7 +134,7 @@ it includes these features and when I do not want a specific thing it is much qu
|
|
134
134
|
- Use sidekiq as a background worker.
|
135
135
|
- Use puma as the server with settings capable of doing phased restarts.
|
136
136
|
- Use foreman in development mode to manage starting both the rails server using puma and sidekiq.
|
137
|
-
- Add a rake task to handle
|
137
|
+
- Add a rake task to handle backups using the `backup` gem.
|
138
138
|
- Set the production asset precompiler to include fonts and png files.
|
139
139
|
- Set the production logger to rotate the logs daily.
|
140
140
|
- Set the timezone to EST.
|
data/lib/orats/cli.rb
CHANGED
@@ -14,7 +14,7 @@ module Orats
|
|
14
14
|
option :auth, type: :boolean, default: false, aliases: '-a'
|
15
15
|
option :template, default: '', aliases: '-m'
|
16
16
|
option :skip_extras, type: :boolean, default: false, aliases: '-E'
|
17
|
-
option :
|
17
|
+
option :skip_server_start, type: :boolean, default: false, aliases: '-F'
|
18
18
|
option :sudo_password, default: '', aliases: '-s'
|
19
19
|
option :skip_galaxy, type: :boolean, default: false, aliases: '-G'
|
20
20
|
desc 'new TARGET_PATH [options]', ''
|
@@ -45,7 +45,7 @@ module Orats
|
|
45
45
|
|
46
46
|
`--skip-extras` skip creating the services directory and ansible inventory/secrets [false]
|
47
47
|
|
48
|
-
`--skip-
|
48
|
+
`--skip-server-start` skip automatically running puma and sidekiq [false]
|
49
49
|
|
50
50
|
Ansible features:
|
51
51
|
|
@@ -71,6 +71,7 @@ module Orats
|
|
71
71
|
end
|
72
72
|
|
73
73
|
option :skip_data, type: :boolean, default: false, aliases: '-D'
|
74
|
+
option :redis_password, default: '', aliases: '-d'
|
74
75
|
desc 'nuke TARGET_PATH [options]', ''
|
75
76
|
long_desc <<-D
|
76
77
|
`orats nuke target_path` will delete the directory and optionally all data associated to it.
|
@@ -78,6 +79,8 @@ module Orats
|
|
78
79
|
Options:
|
79
80
|
|
80
81
|
`--skip-data` will skip deleting app specific postgres databases and redis namespaces [false]
|
82
|
+
|
83
|
+
`--redis-password` to supply your development redis password []
|
81
84
|
D
|
82
85
|
def nuke(target_path)
|
83
86
|
Commands::Nuke.new(target_path, options).init
|
@@ -52,15 +52,8 @@ module Orats
|
|
52
52
|
log_thor_task 'shell', 'Creating ansible secrets'
|
53
53
|
run "mkdir #{secrets_path}"
|
54
54
|
|
55
|
-
if @options[:redis_password].empty?
|
56
|
-
run "touch #{secrets_path}/redis_password"
|
57
|
-
else
|
58
|
-
save_secret_string "#{secrets_path}/redis_password"
|
59
|
-
gsub_file "#{@target_path}/#{fix_path_for_user(Commands::Common::RELATIVE_PATHS[:inventory])}",
|
60
|
-
'redis_password: false', 'redis_password: true'
|
61
|
-
end
|
62
|
-
|
63
55
|
save_secret_string "#{secrets_path}/postgres_password"
|
56
|
+
save_secret_string "#{secrets_path}/redis_password"
|
64
57
|
save_secret_string "#{secrets_path}/mail_password"
|
65
58
|
save_secret_string "#{secrets_path}/rails_token"
|
66
59
|
save_secret_string "#{secrets_path}/devise_token"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'orats/commands/common'
|
2
2
|
require 'orats/commands/new/ansible'
|
3
3
|
require 'orats/commands/new/rails'
|
4
|
-
require 'orats/commands/new/
|
4
|
+
require 'orats/commands/new/server'
|
5
5
|
|
6
6
|
module Orats
|
7
7
|
module Commands
|
@@ -9,7 +9,7 @@ module Orats
|
|
9
9
|
class Exec < Commands::Common
|
10
10
|
include Ansible
|
11
11
|
include Rails
|
12
|
-
include
|
12
|
+
include Server
|
13
13
|
|
14
14
|
def initialize(target_path = '', options = {})
|
15
15
|
super
|
@@ -28,6 +28,7 @@ module Orats
|
|
28
28
|
spring_binstub
|
29
29
|
|
30
30
|
create_and_migrate_database
|
31
|
+
run_rake 'orats:favicons'
|
31
32
|
end
|
32
33
|
|
33
34
|
if @options[:auth]
|
@@ -40,7 +41,7 @@ module Orats
|
|
40
41
|
|
41
42
|
custom_rails_template unless @options[:template].empty?
|
42
43
|
|
43
|
-
|
44
|
+
server_start unless @options[:skip_server_start]
|
44
45
|
end
|
45
46
|
|
46
47
|
private
|
@@ -31,11 +31,9 @@ module Orats
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def gsub_redis_info
|
34
|
-
log_thor_task 'root', '
|
35
|
-
gsub_file "#{@active_path}
|
36
|
-
gsub_file "#{@active_path}/.env", 'HE_PASSWORD: ', "HE_PASSWORD: #{@options[:redis_password]}"
|
34
|
+
log_thor_task 'root', 'Changing the redis password'
|
35
|
+
gsub_file "#{@active_path}/.env", 'HE_PASSWORD: ""', "HE_PASSWORD: #{@options[:redis_password]}"
|
37
36
|
gsub_file "#{@active_path}/.env", 'CACHE_HOST: localhost', "CACHE_HOST: #{@options[:redis_location]}"
|
38
|
-
gsub_file "#{@active_path}/config/application.rb", '# pass', 'pass'
|
39
37
|
|
40
38
|
git_commit 'Add the redis password'
|
41
39
|
end
|
@@ -4,9 +4,9 @@ require 'timeout'
|
|
4
4
|
module Orats
|
5
5
|
module Commands
|
6
6
|
module New
|
7
|
-
module
|
8
|
-
def
|
9
|
-
@options[:
|
7
|
+
module Server
|
8
|
+
def server_start
|
9
|
+
@options[:skip_server_start] ? message = 'Start your' : message = 'Starting'
|
10
10
|
|
11
11
|
puts '', '='*80
|
12
12
|
log_status_top 'action', "#{message} server with the following commands", :cyan
|
data/lib/orats/commands/nuke.rb
CHANGED
@@ -60,7 +60,21 @@ module Orats
|
|
60
60
|
|
61
61
|
def nuke_redis(namespace)
|
62
62
|
log_thor_task 'root', 'Removing redis keys'
|
63
|
-
|
63
|
+
|
64
|
+
while not_able_to_nuke_redis?(@options[:redis_password], namespace)
|
65
|
+
log_status_top 'error', "The redis password you supplied was incorrect\n", :red
|
66
|
+
new_password = ask('Enter the correct password or CTRL+C to quit:', :cyan)
|
67
|
+
puts
|
68
|
+
|
69
|
+
break unless not_able_to_nuke_redis?(new_password, namespace)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def not_able_to_nuke_redis?(password, namespace)
|
74
|
+
password.empty? ? redis_password = '' : redis_password = "-a #{password}"
|
75
|
+
redis_out = run("redis-cli #{redis_password} KEYS '#{namespace}:*' | xargs --delim='\n' redis-cli #{redis_password} DEL", capture: true)
|
76
|
+
|
77
|
+
redis_out.include?('NOAUTH Authentication required')
|
64
78
|
end
|
65
79
|
|
66
80
|
def nuke_directory
|
data/lib/orats/templates/base.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# =====================================================================================================
|
2
|
-
# Template for generating an opinionated base Rails 4.1.0 project using Ruby 2.1.
|
2
|
+
# Template for generating an opinionated base Rails 4.1.0 project using Ruby 2.1.2
|
3
3
|
# =====================================================================================================
|
4
4
|
|
5
5
|
# ----- Helper functions and variables ----------------------------------------------------------------
|
@@ -51,16 +51,12 @@ append_to_file '.gitignore' do <<-TEXT
|
|
51
51
|
*~
|
52
52
|
.idea/
|
53
53
|
|
54
|
-
# Ignore the
|
54
|
+
# Ignore the dotenv file.
|
55
55
|
.env
|
56
56
|
|
57
57
|
# Ignore app specific folders.
|
58
58
|
/vendor/bundle
|
59
59
|
/public/assets/*
|
60
|
-
|
61
|
-
# Ignore backup paths.
|
62
|
-
/lib/backup/log/*
|
63
|
-
/lib/backup/tmp/*
|
64
60
|
TEXT
|
65
61
|
end
|
66
62
|
|
@@ -69,43 +65,24 @@ git commit: "-m 'Add common OS and editor files to the .gitignore file'"
|
|
69
65
|
|
70
66
|
# ----- Add a bundler config --------------------------------------------------------------------
|
71
67
|
|
72
|
-
puts
|
73
|
-
say_status '
|
74
|
-
puts '-'*80, ''; sleep 0.25
|
75
|
-
|
76
|
-
file '.
|
77
|
-
---
|
78
|
-
BUNDLE_WITHOUT: production:staging
|
79
|
-
CODE
|
80
|
-
end
|
81
|
-
|
82
|
-
git add: '-A'
|
83
|
-
git commit: "-m 'Add .
|
84
|
-
|
85
|
-
# ----- Create a few root files -----------------------------------------------------------------------
|
86
|
-
|
87
|
-
puts
|
88
|
-
say_status 'root', 'Creating root files...', :yellow
|
89
|
-
puts '-'*80, ''; sleep 0.25
|
90
|
-
|
91
|
-
file '.ruby-version', '2.1.2'
|
92
|
-
|
93
|
-
git add: '-A'
|
94
|
-
git commit: "-m 'Add .ruby-version file for common ruby version managers'"
|
95
|
-
|
96
|
-
file 'Procfile' do <<-CODE
|
97
|
-
web: puma -C config/puma.rb
|
98
|
-
worker: sidekiq -C config/sidekiq.yml
|
99
|
-
CODE
|
100
|
-
end
|
68
|
+
# puts
|
69
|
+
# say_status 'bundle', 'Creating bundle config...', :yellow
|
70
|
+
# puts '-'*80, ''; sleep 0.25
|
71
|
+
#
|
72
|
+
# file '.bundle/config' do <<-CODE
|
73
|
+
# ---
|
74
|
+
# BUNDLE_WITHOUT: production:staging
|
75
|
+
# CODE
|
76
|
+
# end
|
77
|
+
#
|
78
|
+
# git add: '-A'
|
79
|
+
# git commit: "-m 'Add .bundle/config to ignore production:staging in development mode'"
|
101
80
|
|
102
|
-
git add: '-A'
|
103
|
-
git commit: "-m 'Add a basic Procfile to start the puma and sidekiq processes'"
|
104
81
|
|
105
|
-
# ----- Create
|
82
|
+
# ----- Create a development environment file ---------------------------------------------------
|
106
83
|
|
107
84
|
puts
|
108
|
-
say_status 'root', 'Creating
|
85
|
+
say_status 'root', 'Creating development environment file...', :yellow
|
109
86
|
puts '-'*80, ''; sleep 0.25
|
110
87
|
|
111
88
|
file '.env' do <<-CODE
|
@@ -153,6 +130,24 @@ SIDEKIQ_CONCURRENCY: 25
|
|
153
130
|
CODE
|
154
131
|
end
|
155
132
|
|
133
|
+
git add: '-A'
|
134
|
+
git commit: "-m 'Add development environment file'"
|
135
|
+
|
136
|
+
# ----- Create the foreman Procfile ------------------------------------------------------------------------
|
137
|
+
|
138
|
+
puts
|
139
|
+
say_status 'start', 'Creating the Procfile for foreman...', :yellow
|
140
|
+
puts '-'*80, ''; sleep 0.25
|
141
|
+
|
142
|
+
file 'Procfile' do <<-CODE
|
143
|
+
web: puma -C config/puma.rb
|
144
|
+
worker: sidekiq -C config/sidekiq.yml
|
145
|
+
CODE
|
146
|
+
end
|
147
|
+
|
148
|
+
git add: '-A'
|
149
|
+
git commit: "-m 'Add a basic Procfile to start the puma and sidekiq processes'"
|
150
|
+
|
156
151
|
# ----- Modify the secrets yaml file -----------------------------------------------------------------------
|
157
152
|
|
158
153
|
gsub_file 'config/secrets.yml', /.*\n/, ''
|
@@ -208,12 +203,14 @@ inject_into_file 'config/application.rb', after: "automatically loaded.\n" do <<
|
|
208
203
|
config.action_mailer.default_options = { from: ENV['ACTION_MAILER_DEFAULT_FROM'] }
|
209
204
|
config.action_mailer.default_url_options = { host: ENV['ACTION_MAILER_HOST'] }
|
210
205
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
206
|
+
redis_store_options = { host: ENV['CACHE_HOST'],
|
207
|
+
port: ENV['CACHE_PORT'].to_i,
|
208
|
+
db: ENV['CACHE_DATABASE'].to_i,
|
209
|
+
namespace: '#{app_name}::cache'
|
210
|
+
}
|
211
|
+
redis_store_options[:password] = ENV['CACHE_PASSWORD'] if ENV['CACHE_PASSWORD'].present?
|
212
|
+
|
213
|
+
config.cache_store = :redis_store, redis_store_options
|
217
214
|
CODE
|
218
215
|
end
|
219
216
|
|
@@ -339,7 +336,7 @@ git commit: "-m 'Add the sitemap config'"
|
|
339
336
|
|
340
337
|
file 'config/schedule.rb', <<-CODE
|
341
338
|
every 1.day, at: '3:00 am' do
|
342
|
-
rake 'backup
|
339
|
+
rake 'orats:backup'
|
343
340
|
end
|
344
341
|
|
345
342
|
every 1.day, at: '4:00 am' do
|
@@ -391,8 +388,12 @@ say_status 'config', 'Modifying the initializer files...', :yellow
|
|
391
388
|
puts '-'*80, ''; sleep 0.25
|
392
389
|
|
393
390
|
file 'config/initializers/sidekiq.rb', <<-'CODE'
|
391
|
+
ENV['CACHE_PASSWORD'].present? ? pass_string = ":#{ENV['CACHE_PASSWORD']}@" : pass_string = ''
|
392
|
+
|
393
|
+
redis_host = "#{pass_string}#{ENV['CACHE_HOST']}"
|
394
|
+
|
394
395
|
sidekiq_config = {
|
395
|
-
url: "redis://#{
|
396
|
+
url: "redis://#{redis_host}:#{ENV['CACHE_PORT']}/#{ENV['CACHE_DATABASE']}",
|
396
397
|
namespace: "ns_app::sidekiq_#{Rails.env}"
|
397
398
|
}
|
398
399
|
|
@@ -447,31 +448,52 @@ puts
|
|
447
448
|
say_status 'tasks', 'Creating application tasks...', :yellow
|
448
449
|
puts '-'*80, ''; sleep 0.25
|
449
450
|
|
450
|
-
file 'lib/tasks/favicon.rake', <<-'CODE'
|
451
|
-
namespace :
|
451
|
+
file 'lib/tasks/orats/favicon.rake', <<-'CODE'
|
452
|
+
namespace :orats do
|
452
453
|
desc 'Create favicons from a single base png'
|
453
|
-
task
|
454
|
+
task :favicons do
|
454
455
|
require 'favicon_maker'
|
455
456
|
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
457
|
+
FaviconMaker.generate do
|
458
|
+
setup do
|
459
|
+
template_dir Rails.root.join('app', 'assets', 'favicon')
|
460
|
+
output_dir Rails.root.join('public')
|
461
|
+
end
|
462
|
+
|
463
|
+
favicon_base_path = "#{template_dir}/favicon_base.png"
|
464
|
+
|
465
|
+
unless File.exist?(favicon_base_path)
|
466
|
+
puts
|
467
|
+
puts 'A base favicon could not be found, make sure one exists at:'
|
468
|
+
puts base_favicon
|
469
|
+
puts
|
470
|
+
exit 1
|
471
|
+
end
|
472
|
+
|
473
|
+
from File.basename(favicon_base_path) do
|
474
|
+
icon 'speeddial-160x160.png'
|
475
|
+
icon 'apple-touch-icon-228x228-precomposed.png'
|
476
|
+
icon 'apple-touch-icon-152x152-precomposed.png'
|
477
|
+
icon 'apple-touch-icon-144x144-precomposed.png'
|
478
|
+
icon 'apple-touch-icon-120x120-precomposed.png'
|
479
|
+
icon 'apple-touch-icon-114x114-precomposed.png'
|
480
|
+
icon 'apple-touch-icon-76x76-precomposed.png'
|
481
|
+
icon 'apple-touch-icon-72x72-precomposed.png'
|
482
|
+
icon 'apple-touch-icon-60x60-precomposed.png'
|
483
|
+
icon 'apple-touch-icon-57x57-precomposed.png'
|
484
|
+
icon 'favicon-196x196.png'
|
485
|
+
icon 'favicon-160x160.png'
|
486
|
+
icon 'favicon-96x96.png'
|
487
|
+
icon 'favicon-64x64.png'
|
488
|
+
icon 'favicon-32x32.png'
|
489
|
+
icon 'favicon-24x24.png'
|
490
|
+
icon 'favicon-16x16.png'
|
491
|
+
icon 'favicon.ico', size: '64x64,32x32,24x24,16x16'
|
492
|
+
end
|
493
|
+
|
494
|
+
each_icon do |filepath|
|
495
|
+
puts "Creating favicon for: #{File.basename filepath}"
|
496
|
+
end
|
475
497
|
end
|
476
498
|
end
|
477
499
|
end
|
@@ -480,24 +502,32 @@ CODE
|
|
480
502
|
git add: '-A'
|
481
503
|
git commit: "-m 'Add a favicon generator task'"
|
482
504
|
|
483
|
-
file 'lib/tasks/backup.rake', <<-'CODE'
|
484
|
-
namespace :
|
485
|
-
desc 'Create a backup of your
|
486
|
-
task :
|
487
|
-
|
488
|
-
|
505
|
+
file 'lib/tasks/orats/backup.rake', <<-'CODE'
|
506
|
+
namespace :orats do
|
507
|
+
desc 'Create a backup of your application for a specific environment'
|
508
|
+
task :backup do
|
509
|
+
if File.exist?('.env') && File.file?('.env')
|
510
|
+
require 'dotenv'
|
511
|
+
Dotenv.load
|
512
|
+
|
513
|
+
source_external_env = ''
|
514
|
+
else
|
515
|
+
source_external_env = '. /etc/default/app_name &&'
|
516
|
+
end
|
489
517
|
|
490
|
-
#
|
491
|
-
#
|
492
|
-
|
518
|
+
# hack'ish way to run the backup command with elevated privileges, it won't prompt for a password on the production
|
519
|
+
# server because passwordless sudo has been enabled if you use the ansible setup provided by orats
|
520
|
+
system 'sudo whoami'
|
493
521
|
|
494
|
-
system "#{
|
522
|
+
system "#{source_external_env} backup perform -t backup -c '#{File.join('lib', 'backup', 'config.rb')}' --log-path='#{File.join('log')}'"
|
495
523
|
end
|
496
524
|
end
|
497
525
|
CODE
|
498
526
|
|
527
|
+
gsub_file 'lib/tasks/orats/backup.rake', 'app_name', app_name
|
528
|
+
|
499
529
|
git add: '-A'
|
500
|
-
git commit: "-m 'Add a
|
530
|
+
git commit: "-m 'Add a backup task'"
|
501
531
|
|
502
532
|
# ----- Creating application backup --------------------------------------------------------------------
|
503
533
|
|
@@ -544,7 +574,7 @@ root_path 'lib/backup'
|
|
544
574
|
# May be an absolute path, or relative to the current directory or +root_path+.
|
545
575
|
#
|
546
576
|
|
547
|
-
tmp_path 'tmp'
|
577
|
+
tmp_path '../../tmp'
|
548
578
|
|
549
579
|
#
|
550
580
|
# Sets the path where backup stores persistent information.
|
@@ -552,7 +582,7 @@ tmp_path 'tmp'
|
|
552
582
|
# May be an absolute path, or relative to the current directory or +root_path+.
|
553
583
|
#
|
554
584
|
|
555
|
-
data_path 'data'
|
585
|
+
data_path '../../tmp/backup/data'
|
556
586
|
|
557
587
|
##
|
558
588
|
# Utilities
|
@@ -637,12 +667,14 @@ CODE
|
|
637
667
|
git add: '-A'
|
638
668
|
git commit: "-m 'Add backup config'"
|
639
669
|
|
640
|
-
file 'lib/backup/models/
|
641
|
-
Model.new(:
|
670
|
+
file 'lib/backup/models/backup.rb', <<-'CODE'
|
671
|
+
Model.new(:backup, 'Backup for the current RAILS_ENV') do
|
642
672
|
split_into_chunks_of 10
|
643
673
|
compress_with Gzip
|
644
674
|
|
645
675
|
database PostgreSQL do |db|
|
676
|
+
db.sudo_user = ENV['DATABASE_USERNAME']
|
677
|
+
|
646
678
|
# To dump all databases, set `db.name = :all` (or leave blank)
|
647
679
|
db.name = ENV['DATABASE_NAME']
|
648
680
|
db.username = ENV['DATABASE_USERNAME']
|
@@ -672,7 +704,7 @@ Model.new(:production_backup, 'Production backup') do
|
|
672
704
|
# s3.secret_access_key = ENV['S3_SECRET_ACCESS_KEY']
|
673
705
|
# s3.region = ENV['S3_REGION']
|
674
706
|
# s3.bucket = 'backup'
|
675
|
-
# s3.path =
|
707
|
+
# s3.path = "/database/#{ENV['RAILS_ENV']}"
|
676
708
|
# end
|
677
709
|
|
678
710
|
ENV['SMTP_ENCRYPTION'].empty? ? mail_encryption = 'none' : mail_encryption = ENV['SMTP_ENCRYPTION']
|
@@ -718,20 +750,25 @@ inject_into_file 'app/helpers/application_helper.rb', after: "ApplicationHelper\
|
|
718
750
|
end
|
719
751
|
|
720
752
|
def link_to_all_favicons
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
753
|
+
'<link href="speeddial-160x160.png" rel="icon" type="image/png" />
|
754
|
+
<link href="apple-touch-icon-228x228-precomposed.png" rel="apple-touch-icon-precomposed" sizes="228x228" type="image/png" />
|
755
|
+
<link href="apple-touch-icon-152x152-precomposed.png" rel="apple-touch-icon-precomposed" sizes="152x152" type="image/png" />
|
756
|
+
<link href="apple-touch-icon-144x144-precomposed.png" rel="apple-touch-icon-precomposed" sizes="144x144" type="image/png" />
|
757
|
+
<link href="apple-touch-icon-120x120-precomposed.png" rel="apple-touch-icon-precomposed" sizes="120x120" type="image/png" />
|
758
|
+
<link href="apple-touch-icon-114x114-precomposed.png" rel="apple-touch-icon-precomposed" sizes="114x114" type="image/png" />
|
759
|
+
<link href="apple-touch-icon-76x76-precomposed.png" rel="apple-touch-icon-precomposed" sizes="76x76" type="image/png" />
|
760
|
+
<link href="apple-touch-icon-72x72-precomposed.png" rel="apple-touch-icon-precomposed" sizes="72x72" type="image/png" />
|
761
|
+
<link href="apple-touch-icon-60x60-precomposed.png" rel="apple-touch-icon-precomposed" sizes="60x60" type="image/png" />
|
762
|
+
<link href="apple-touch-icon-57x57-precomposed.png" rel="apple-touch-icon-precomposed" sizes="57x57" type="image/png" />
|
763
|
+
<link href="favicon-196x196.png" rel="icon" sizes="196x196" type="image/png" />
|
764
|
+
<link href="favicon-160x160.png" rel="icon" sizes="160x160" type="image/png" />
|
765
|
+
<link href="favicon-96x96.png" rel="icon" sizes="96x96" type="image/png" />
|
766
|
+
<link href="favicon-64x64.png" rel="icon" sizes="64x64" type="image/png" />
|
767
|
+
<link href="favicon-32x32.png" rel="icon" sizes="32x32" type="image/png" />
|
768
|
+
<link href="favicon-24x24.png" rel="icon" sizes="24x24" type="image/png" />
|
769
|
+
<link href="favicon-16x16.png" rel="icon" sizes="16x16" type="image/png" />
|
770
|
+
<link href="favicon.ico" rel="icon" type="image/x-icon" />
|
771
|
+
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon" />'.html_safe
|
735
772
|
end
|
736
773
|
|
737
774
|
def humanize_boolean(input)
|
@@ -1167,4 +1204,17 @@ run 'rm -f Gemfile'
|
|
1167
1204
|
from_gem 'Gemfile', 'Gemfile'
|
1168
1205
|
|
1169
1206
|
git add: '-A'
|
1170
|
-
git commit: "-m 'Add basic gems to the Gemfile'"
|
1207
|
+
git commit: "-m 'Add basic gems to the Gemfile'"
|
1208
|
+
|
1209
|
+
# ----- Adding default favicon-------------------------------------------------------------------------
|
1210
|
+
|
1211
|
+
puts
|
1212
|
+
say_status 'assets', 'Copying default favicon...', :yellow
|
1213
|
+
puts '-'*80, ''; sleep 0.25
|
1214
|
+
|
1215
|
+
base_path = "#{File.expand_path File.dirname(__FILE__)}/includes"
|
1216
|
+
run 'mkdir -p app/assets/favicon'
|
1217
|
+
run "cp #{base_path}/app/assets/favicon/favicon_base.png app/assets/favicon/favicon_base.png"
|
1218
|
+
|
1219
|
+
git add: '-A'
|
1220
|
+
git commit: "-m 'Add default 256x256 favicon'"
|
@@ -1,11 +1,11 @@
|
|
1
1
|
nickjj.user,v0.1.0
|
2
2
|
nickjj.security,v0.1.1
|
3
|
-
nickjj.postgres,v0.1.
|
3
|
+
nickjj.postgres,v0.1.2
|
4
4
|
nickjj.ruby,v0.1.4
|
5
5
|
nickjj.nodejs,v0.1.1
|
6
6
|
nickjj.nginx,v0.1.3
|
7
7
|
nickjj.rails,v0.1.92
|
8
|
-
nickjj.whenever,v0.1.
|
8
|
+
nickjj.whenever,v0.1.1
|
9
9
|
nickjj.pumacorn,v0.1.1
|
10
10
|
nickjj.sidekiq,v0.1.1
|
11
11
|
nickjj.monit,v0.1.2
|
@@ -15,22 +15,22 @@ gem 'sidekiq', '~> 3.1.2'
|
|
15
15
|
gem 'sinatra', '>= 1.4.5', require: false
|
16
16
|
#gem 'jbuilder'
|
17
17
|
|
18
|
-
gem 'kaminari', '~> 0.
|
18
|
+
gem 'kaminari', '~> 0.16.0'
|
19
19
|
|
20
20
|
gem 'sitemap_generator', '~> 5.0.2'
|
21
|
-
gem 'favicon_maker', '~> 1.
|
21
|
+
gem 'favicon_maker', '~> 1.3'
|
22
22
|
|
23
23
|
group :development do
|
24
24
|
gem 'spring', '~> 1.1.2'
|
25
25
|
gem 'foreman', require: false
|
26
26
|
gem 'rack-mini-profiler', '~> 0.9.1'
|
27
|
-
gem 'bullet', '~> 4.
|
27
|
+
gem 'bullet', '~> 4.10.0'
|
28
28
|
gem 'meta_request', '~> 0.3.0'
|
29
29
|
gem 'railroady', '~> 1.1.1', require: false
|
30
30
|
end
|
31
31
|
|
32
32
|
group :development, :test do
|
33
|
-
gem 'dotenv-rails', '~> 0.
|
33
|
+
gem 'dotenv-rails', '~> 0.11.1'
|
34
34
|
end
|
35
35
|
|
36
36
|
group :staging, :production do
|
Binary file
|
@@ -26,7 +26,7 @@ redis_port: 6379
|
|
26
26
|
redis_version: 2.8.9
|
27
27
|
redis_install_dir: /usr/local
|
28
28
|
redis_dir: /usr/local/redis
|
29
|
-
redis_password:
|
29
|
+
redis_password: "{{ secrets_redis_password }}"
|
30
30
|
|
31
31
|
# rails application configuration
|
32
32
|
rails_deploy_app_name: testproj
|
@@ -50,6 +50,7 @@ rails_deploy_env:
|
|
50
50
|
RAILS_ENV: production
|
51
51
|
|
52
52
|
PROJECT_PATH: "{{ rails_deploy_path }}"
|
53
|
+
SOURCE_ENV_PATH: "/etc/default/{{ rails_deploy_app_name }}"
|
53
54
|
|
54
55
|
GOOGLE_ANALYTICS_UA: ""
|
55
56
|
DISQUS_SHORT_NAME: ""
|
@@ -94,8 +95,11 @@ rails_deploy_env:
|
|
94
95
|
|
95
96
|
SIDEKIQ_CONCURRENCY: 25
|
96
97
|
|
98
|
+
# whenever configuration
|
99
|
+
whenever_update: rails_deploy_app_name
|
100
|
+
|
97
101
|
# nginx configuration
|
98
|
-
nginx_base_domain:
|
102
|
+
nginx_base_domain: localhost
|
99
103
|
nginx_upstream_name: "{{ rails_deploy_app_name }}"
|
100
104
|
nginx_upstream_server: unix://{{ rails_deploy_path }}/tmp/puma.sock
|
101
105
|
nginx_root_path: "{{ rails_deploy_path }}/public"
|
data/lib/orats/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
require 'minitest/autorun'
|
2
2
|
require 'securerandom'
|
3
|
-
require_relative '../lib/orats/
|
3
|
+
require_relative '../lib/orats/server'
|
4
4
|
|
5
5
|
module Orats
|
6
6
|
module Test
|
7
|
-
include
|
7
|
+
include Server
|
8
8
|
|
9
9
|
BINARY_PATH = File.absolute_path('../../bin/orats',__FILE__)
|
10
10
|
TEST_PATH = '/tmp/orats/test'
|
11
|
-
ORATS_FLAGS = '--pg-password pleasedonthackme --skip-
|
11
|
+
ORATS_FLAGS = '--pg-password pleasedonthackme --skip-server-start'
|
12
12
|
|
13
13
|
def orats(command, options = {})
|
14
14
|
cmd, app_name = command.split(' ')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Janetakis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -86,8 +86,8 @@ files:
|
|
86
86
|
- lib/orats/commands/common.rb
|
87
87
|
- lib/orats/commands/new/ansible.rb
|
88
88
|
- lib/orats/commands/new/exec.rb
|
89
|
-
- lib/orats/commands/new/foreman.rb
|
90
89
|
- lib/orats/commands/new/rails.rb
|
90
|
+
- lib/orats/commands/new/server.rb
|
91
91
|
- lib/orats/commands/nuke.rb
|
92
92
|
- lib/orats/commands/outdated/compare.rb
|
93
93
|
- lib/orats/commands/outdated/exec.rb
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- lib/orats/templates/base.rb
|
99
99
|
- lib/orats/templates/includes/Galaxyfile
|
100
100
|
- lib/orats/templates/includes/Gemfile
|
101
|
+
- lib/orats/templates/includes/app/assets/favicon/favicon_base.png
|
101
102
|
- lib/orats/templates/includes/inventory/group_vars/all.yml
|
102
103
|
- lib/orats/templates/includes/inventory/hosts
|
103
104
|
- lib/orats/templates/play.rb
|