rails_template_18f 0.3.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/Gemfile +0 -2
  4. data/Gemfile.lock +4 -4
  5. data/exe/rails_template_18f +31 -0
  6. data/lib/generators/rails_template18f/active_storage/active_storage_generator.rb +141 -0
  7. data/lib/generators/rails_template18f/active_storage/templates/app/jobs/file_scan_job.rb +33 -0
  8. data/lib/generators/rails_template18f/active_storage/templates/app/models/file_upload.rb +25 -0
  9. data/lib/generators/rails_template18f/active_storage/templates/doc/adr/clamav.md.tt +30 -0
  10. data/lib/generators/rails_template18f/active_storage/templates/spec/jobs/file_scan_job_spec.rb +35 -0
  11. data/lib/generators/rails_template18f/active_storage/templates/spec/models/file_upload_spec.rb +38 -0
  12. data/lib/generators/rails_template18f/circleci/circleci_generator.rb +4 -1
  13. data/lib/generators/rails_template18f/cloud_gov_config/cloud_gov_config_generator.rb +29 -0
  14. data/lib/generators/rails_template18f/cloud_gov_config/templates/app/models/cloud_gov_config.rb +15 -0
  15. data/lib/generators/rails_template18f/cloud_gov_config/templates/spec/models/cloud_gov_config_spec.rb +44 -0
  16. data/lib/generators/rails_template18f/i18n/i18n_generator.rb +8 -9
  17. data/lib/generators/rails_template18f/i18n_js/i18n_js_generator.rb +59 -0
  18. data/lib/generators/rails_template18f/i18n_js/templates/lib/tasks/i18n.rake +9 -0
  19. data/lib/generators/rails_template18f/newrelic/newrelic_generator.rb +2 -0
  20. data/lib/generators/rails_template18f/sidekiq/sidekiq_generator.rb +81 -0
  21. data/lib/generators/rails_template18f/sidekiq/templates/config/initializers/redis.rb +14 -0
  22. data/lib/generators/rails_template18f/terraform/templates/terraform/README.md.tt +1 -1
  23. data/lib/generators/rails_template18f/terraform/templates/terraform/production/main.tf.tt +37 -5
  24. data/lib/generators/rails_template18f/terraform/templates/terraform/shared/clamav/main.tf.tt +50 -0
  25. data/lib/generators/rails_template18f/terraform/templates/terraform/shared/clamav/providers.tf +16 -0
  26. data/lib/generators/rails_template18f/terraform/templates/terraform/shared/clamav/variables.tf +47 -0
  27. data/lib/generators/rails_template18f/terraform/templates/terraform/shared/redis/main.tf.tt +23 -0
  28. data/lib/generators/rails_template18f/terraform/templates/terraform/shared/redis/providers.tf +16 -0
  29. data/lib/generators/rails_template18f/terraform/templates/terraform/shared/redis/variables.tf +42 -0
  30. data/lib/generators/rails_template18f/terraform/templates/terraform/staging/main.tf.tt +37 -5
  31. data/lib/generators/rails_template18f/terraform/terraform_generator.rb +10 -12
  32. data/lib/rails_template18f/app_updater.rb +19 -0
  33. data/lib/rails_template18f/generators/base.rb +37 -5
  34. data/lib/rails_template18f/generators/cloud_gov_options.rb +0 -4
  35. data/lib/rails_template18f/version.rb +1 -1
  36. data/rails-template-18f.gemspec +1 -0
  37. data/template.rb +29 -1
  38. data/templates/Brewfile +14 -0
  39. data/templates/README.md.tt +9 -10
  40. data/templates/app/views/application/_header.html.erb +0 -1
  41. data/templates/app/views/application/_usa_banner.html.erb +2 -0
  42. data/templates/bin/with-server +1 -2
  43. data/templates/config/deployment/staging.yml +1 -1
  44. data/templates/config/environments/ci.rb +0 -1
  45. data/templates/doc/compliance/apps/application.boundary.md.tt +0 -7
  46. data/templates/env +1 -1
  47. metadata +37 -2
@@ -12,16 +12,15 @@ guide for an introduction to the framework.
12
12
 
13
13
  * Install Ruby <%= @ruby_version %>
14
14
  * Install NodeJS <%= @node_version %>
15
- * Install PostgreSQL: `brew install postgresql`
16
- * Add postgres to your PATH if it wasn't done automatically
17
- `echo 'export PATH="/usr/local/opt/postgresql/bin:$PATH"' >> ~/.zshrc`
18
- * Start the server
19
- `brew services start postgresql`
15
+ * Install homebrew dependencies: `brew bundle`
16
+ * [PostgreSQL](https://www.postgresql.org/)
17
+ * [Dockerize](https://github.com/jwilder/dockerize)
18
+ * [ADR Tools](https://github.com/npryce/adr-tools)
19
+ * [Chromedriver](https://sites.google.com/chromium.org/driver/)
20
+ * Chromedriver must be allowed to run. You can either do that by:
21
+ * The command line: `xattr -d com.apple.quarantine $(which chromedriver)` (this is the only option if you are on Big Sur)
22
+ * Manually: clicking "allow" when you run the integration tests for the first time and a dialogue opens up
20
23
  * Install Ruby dependencies: `bundle install`
21
- * Install chromedriver for integration tests: `brew install --cask chromedriver`
22
- * Chromedriver must be allowed to run. You can either do that by:
23
- * The command line: `xattr -d com.apple.quarantine $(which chromedriver)` (this is the only option if you are on Big Sur)
24
- * Manually: clicking "allow" when you run the integration tests for the first time and a dialogue opens up
25
24
  * Install JS dependencies: `yarn install`
26
25
  * Create database: `bundle exec rake db:create`
27
26
  * Run migrations: `bundle exec rake db:migrate`
@@ -145,7 +144,7 @@ Configuration that changes from staging to production, but is public, should be
145
144
  Architectural Decision Records (ADR) are stored in `doc/adr`
146
145
  To create a new ADR, first install [ADR-tools](https://github.com/npryce/adr-tools) if you don't
147
146
  already have it installed.
148
- * `brew install adr-tools`
147
+ * `brew bundle` or `brew install adr-tools`
149
148
 
150
149
  Then create the ADR:
151
150
  * `adr new Title Of Architectural Decision`
@@ -1,6 +1,5 @@
1
1
  <div class="usa-overlay"></div>
2
2
  <header class="usa-header usa-header--basic">
3
- <%= render "application/demo_site_banner" if Rails.configuration.x.show_demo_banner %>
4
3
  <div class="usa-nav-container">
5
4
  <div class="usa-navbar">
6
5
  <div class="usa-logo">
@@ -49,3 +49,5 @@
49
49
  </div>
50
50
  </div>
51
51
  </section>
52
+
53
+ <%= render "application/demo_site_banner" if Rails.configuration.x.show_demo_banner %>
@@ -20,9 +20,8 @@ bundle exec rake assets:precompile
20
20
  # run the server
21
21
  bundle exec rails server &
22
22
  server_pid=$!
23
- # pause to ensure the server has started
24
- sleep 5
25
23
 
24
+ dockerize -wait http://localhost:3000 -timeout 1m
26
25
 
27
26
  $@
28
27
  exit_status=$?
@@ -1,3 +1,3 @@
1
1
  env: staging
2
2
  web_instances: 1
3
- web_memory: 512M
3
+ web_memory: 256M
@@ -1,7 +1,6 @@
1
1
  require_relative "./production"
2
2
 
3
3
  Rails.application.configure do
4
- config.assets.compile = true
5
4
  config.public_file_server.enabled = true
6
5
 
7
6
  logger = ActiveSupport::Logger.new($stdout)
@@ -30,15 +30,11 @@ Boundary(aws, "AWS GovCloud") {
30
30
  System_Boundary(inventory, "Application") {
31
31
  Container(app, "<&layers> <%= app_name.titleize %>", "Ruby <%= @ruby_version %>, Rails <%= Rails.version %>", "TKTK Application Description")
32
32
  ContainerDb(app_db, "Application DB", "AWS RDS (PostgreSQL)", "Primary data storage")
33
- <% if !skip_active_storage? %>
34
- ContainerDb(app_s3, "File Storage", "AWS S3", "User-uploaded file storage")
35
- <% end %>
36
33
  }
37
34
  }
38
35
  }
39
36
  }
40
37
 
41
-
42
38
  Boundary(gsa_saas, "GSA-authorized SaaS") {
43
39
  }
44
40
 
@@ -49,9 +45,6 @@ Rel(browser, aws_alb, "request info, submit requests", "https GET/POST (443)")
49
45
  Rel(aws_alb, cloudgov_router, "proxies requests", "https GET/POST (443)")
50
46
  Rel(cloudgov_router, app, "proxies requests", "https GET/POST (443)")
51
47
  Rel(app, app_db, "reads/writes primary data", "psql (5432)")
52
- <% if !skip_active_storage? %>
53
- Rel(app, app_s3, "reads/writes file data", "https (443)")
54
- <% end %>
55
48
  @enduml
56
49
  ```
57
50
 
data/templates/env CHANGED
@@ -7,4 +7,4 @@
7
7
  ###################################################################################################
8
8
 
9
9
  # SHOW_DEMO_BANNER controls whether to show the TEST SITE banner in Rails.env.development
10
- SHOW_DEMO_BANNER=false
10
+ SHOW_DEMO_BANNER=false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_template_18f
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Ahearn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-17 00:00:00.000000000 Z
11
+ date: 2022-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: colorize
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.8'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.8'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -114,11 +128,20 @@ files:
114
128
  - bin/console
115
129
  - bin/setup
116
130
  - exe/rails_template_18f
131
+ - lib/generators/rails_template18f/active_storage/active_storage_generator.rb
132
+ - lib/generators/rails_template18f/active_storage/templates/app/jobs/file_scan_job.rb
133
+ - lib/generators/rails_template18f/active_storage/templates/app/models/file_upload.rb
134
+ - lib/generators/rails_template18f/active_storage/templates/doc/adr/clamav.md.tt
135
+ - lib/generators/rails_template18f/active_storage/templates/spec/jobs/file_scan_job_spec.rb
136
+ - lib/generators/rails_template18f/active_storage/templates/spec/models/file_upload_spec.rb
117
137
  - lib/generators/rails_template18f/circleci/circleci_generator.rb
118
138
  - lib/generators/rails_template18f/circleci/templates/Dockerfile.tt
119
139
  - lib/generators/rails_template18f/circleci/templates/bin/ci-server-start
120
140
  - lib/generators/rails_template18f/circleci/templates/circleci/config.yml.tt
121
141
  - lib/generators/rails_template18f/circleci/templates/docker-compose.ci.yml
142
+ - lib/generators/rails_template18f/cloud_gov_config/cloud_gov_config_generator.rb
143
+ - lib/generators/rails_template18f/cloud_gov_config/templates/app/models/cloud_gov_config.rb
144
+ - lib/generators/rails_template18f/cloud_gov_config/templates/spec/models/cloud_gov_config_spec.rb
122
145
  - lib/generators/rails_template18f/dap/dap_generator.rb
123
146
  - lib/generators/rails_template18f/github_actions/github_actions_generator.rb
124
147
  - lib/generators/rails_template18f/github_actions/templates/github/actions/run-server/action.yml
@@ -139,8 +162,12 @@ files:
139
162
  - lib/generators/rails_template18f/i18n/templates/config/locales/es.yml
140
163
  - lib/generators/rails_template18f/i18n/templates/config/locales/fr.yml
141
164
  - lib/generators/rails_template18f/i18n/templates/config/locales/zh.yml
165
+ - lib/generators/rails_template18f/i18n_js/i18n_js_generator.rb
166
+ - lib/generators/rails_template18f/i18n_js/templates/lib/tasks/i18n.rake
142
167
  - lib/generators/rails_template18f/newrelic/newrelic_generator.rb
143
168
  - lib/generators/rails_template18f/newrelic/templates/config/newrelic.yml.tt
169
+ - lib/generators/rails_template18f/sidekiq/sidekiq_generator.rb
170
+ - lib/generators/rails_template18f/sidekiq/templates/config/initializers/redis.rb
144
171
  - lib/generators/rails_template18f/terraform/templates/terraform/README.md.tt
145
172
  - lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/import.sh
146
173
  - lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/main.tf.tt
@@ -153,12 +180,18 @@ files:
153
180
  - lib/generators/rails_template18f/terraform/templates/terraform/production/main.tf.tt
154
181
  - lib/generators/rails_template18f/terraform/templates/terraform/production/providers.tf.tt
155
182
  - lib/generators/rails_template18f/terraform/templates/terraform/production/variables.tf
183
+ - lib/generators/rails_template18f/terraform/templates/terraform/shared/clamav/main.tf.tt
184
+ - lib/generators/rails_template18f/terraform/templates/terraform/shared/clamav/providers.tf
185
+ - lib/generators/rails_template18f/terraform/templates/terraform/shared/clamav/variables.tf
156
186
  - lib/generators/rails_template18f/terraform/templates/terraform/shared/database/main.tf.tt
157
187
  - lib/generators/rails_template18f/terraform/templates/terraform/shared/database/providers.tf
158
188
  - lib/generators/rails_template18f/terraform/templates/terraform/shared/database/variables.tf
159
189
  - lib/generators/rails_template18f/terraform/templates/terraform/shared/domain/main.tf.tt
160
190
  - lib/generators/rails_template18f/terraform/templates/terraform/shared/domain/providers.tf
161
191
  - lib/generators/rails_template18f/terraform/templates/terraform/shared/domain/variables.tf
192
+ - lib/generators/rails_template18f/terraform/templates/terraform/shared/redis/main.tf.tt
193
+ - lib/generators/rails_template18f/terraform/templates/terraform/shared/redis/providers.tf
194
+ - lib/generators/rails_template18f/terraform/templates/terraform/shared/redis/variables.tf
162
195
  - lib/generators/rails_template18f/terraform/templates/terraform/shared/s3/main.tf
163
196
  - lib/generators/rails_template18f/terraform/templates/terraform/shared/s3/providers.tf
164
197
  - lib/generators/rails_template18f/terraform/templates/terraform/shared/s3/variables.tf
@@ -166,6 +199,7 @@ files:
166
199
  - lib/generators/rails_template18f/terraform/templates/terraform/staging/providers.tf.tt
167
200
  - lib/generators/rails_template18f/terraform/templates/terraform/staging/variables.tf
168
201
  - lib/generators/rails_template18f/terraform/terraform_generator.rb
202
+ - lib/rails_template18f/app_updater.rb
169
203
  - lib/rails_template18f/generators.rb
170
204
  - lib/rails_template18f/generators/base.rb
171
205
  - lib/rails_template18f/generators/cloud_gov_options.rb
@@ -176,6 +210,7 @@ files:
176
210
  - railsrc
177
211
  - railsrc-hotwire
178
212
  - template.rb
213
+ - templates/Brewfile
179
214
  - templates/README.md.tt
180
215
  - templates/app/assets/images/uswds.js
181
216
  - templates/app/assets/stylesheets/uswds-settings.scss