rails_template_18f 1.3.0 → 2.1.0

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.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +64 -61
  5. data/README.md +11 -16
  6. data/lib/generators/rails_template18f/active_storage/active_storage_generator.rb +7 -6
  7. data/lib/generators/rails_template18f/circleci/circleci_generator.rb +28 -27
  8. data/lib/generators/rails_template18f/circleci/templates/Dockerfile.ci.tt +0 -1
  9. data/lib/generators/rails_template18f/circleci/templates/circleci/config.yml.tt +162 -163
  10. data/lib/generators/rails_template18f/cloud_gov_config/templates/app/models/cloud_gov_config.rb +9 -1
  11. data/lib/generators/rails_template18f/github_actions/github_actions_generator.rb +31 -30
  12. data/lib/generators/rails_template18f/github_actions/templates/github/actions/compile-assets/action.yml +50 -0
  13. data/lib/generators/rails_template18f/github_actions/templates/github/actions/setup-project/action.yml.tt +4 -8
  14. data/lib/generators/rails_template18f/github_actions/templates/github/dependabot.yml.tt +2 -4
  15. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml +74 -0
  16. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml +74 -0
  17. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-daily-scan.yml.tt +10 -1
  18. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-scan.yml.tt +1 -1
  19. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/pa11y.yml.tt +2 -2
  20. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/terraform-production.yml +49 -4
  21. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/terraform-staging.yml +49 -4
  22. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/validate-ssp.yml +2 -2
  23. data/lib/generators/rails_template18f/gitlab_ci/gitlab_ci_generator.rb +147 -0
  24. data/lib/generators/rails_template18f/gitlab_ci/templates/gitlab/node.yml.tt +11 -0
  25. data/lib/generators/rails_template18f/gitlab_ci/templates/gitlab/rails.yml +75 -0
  26. data/lib/generators/rails_template18f/gitlab_ci/templates/gitlab/ruby.yml +7 -0
  27. data/lib/generators/rails_template18f/gitlab_ci/templates/gitlab/terraform.yml +28 -0
  28. data/lib/generators/rails_template18f/gitlab_ci/templates/gitlab-ci.yml.tt +212 -0
  29. data/lib/generators/rails_template18f/i18n_js/i18n_js_generator.rb +2 -2
  30. data/lib/generators/rails_template18f/i18n_js/templates/app/javascript/{i18n.js → i18n/index.js} +1 -1
  31. data/lib/generators/rails_template18f/i18n_js/templates/config/i18n-js.yml +1 -1
  32. data/lib/generators/rails_template18f/newrelic/newrelic_generator.rb +4 -2
  33. data/lib/generators/rails_template18f/public_egress/public_egress_generator.rb +71 -55
  34. data/lib/generators/rails_template18f/sidekiq/sidekiq_generator.rb +8 -17
  35. data/lib/generators/rails_template18f/terraform/templates/full_bootstrap/imports.tf.tftpl +25 -0
  36. data/lib/generators/rails_template18f/terraform/templates/full_bootstrap/main.tf.tt +159 -0
  37. data/lib/generators/rails_template18f/terraform/templates/sandbox_bootstrap/imports.tf.tftpl +10 -0
  38. data/lib/generators/rails_template18f/terraform/templates/sandbox_bootstrap/main.tf.tt +117 -0
  39. data/lib/generators/rails_template18f/terraform/templates/terraform/README.md.tt +69 -95
  40. data/lib/generators/rails_template18f/terraform/templates/terraform/app.tf.tt +57 -0
  41. data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/apply.sh +15 -0
  42. data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/templates/backend_config.tftpl +8 -0
  43. data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/templates/bot_secrets.tftpl +5 -0
  44. data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/users.auto.tfvars +5 -0
  45. data/lib/generators/rails_template18f/terraform/templates/terraform/main.tf.tt +117 -0
  46. data/lib/generators/rails_template18f/terraform/templates/terraform/production.tfvars.tt +13 -0
  47. data/lib/generators/rails_template18f/terraform/templates/terraform/providers.tf.tt +18 -0
  48. data/lib/generators/rails_template18f/terraform/templates/terraform/staging.tfvars.tt +8 -0
  49. data/lib/generators/rails_template18f/terraform/templates/terraform/terraform.sh.tt +95 -0
  50. data/lib/generators/rails_template18f/terraform/templates/terraform/variables.tf.tt +98 -0
  51. data/lib/generators/rails_template18f/terraform/terraform_generator.rb +12 -4
  52. data/lib/rails_template18f/generators/cloud_gov_options.rb +9 -6
  53. data/lib/rails_template18f/generators/cloud_gov_parsing.rb +7 -7
  54. data/lib/rails_template18f/generators.rb +0 -1
  55. data/lib/rails_template18f/version.rb +1 -1
  56. data/rails-template-18f.gemspec +4 -4
  57. data/railsrc +4 -2
  58. data/railsrc-hotwire +4 -2
  59. data/template.rb +80 -82
  60. data/templates/README.md.tt +21 -8
  61. data/templates/app/assets/stylesheets/uswds-settings.scss +3 -2
  62. data/templates/app/views/application/_header.html.erb +1 -1
  63. data/templates/app/views/application/_usa_banner.html.erb +3 -3
  64. data/templates/bin/ops/create_service_account.sh.tt +20 -11
  65. data/templates/bin/ops/destroy_service_account.sh.tt +3 -3
  66. data/templates/browserslistrc +1 -2
  67. data/templates/doc/compliance/TODO.md +1 -4
  68. data/templates/{pa11yci.js → pa11yci.js.tt} +5 -0
  69. metadata +36 -35
  70. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt +0 -50
  71. data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml.tt +0 -50
  72. data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/import.sh +0 -13
  73. data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/main.tf.tt +0 -22
  74. data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/providers.tf +0 -16
  75. data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/run.sh.tt +0 -40
  76. data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/teardown_creds.sh.tt +0 -5
  77. data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/variables.tf +0 -2
  78. data/lib/generators/rails_template18f/terraform/templates/terraform/production/main.tf.tt +0 -90
  79. data/lib/generators/rails_template18f/terraform/templates/terraform/production/providers.tf +0 -23
  80. data/lib/generators/rails_template18f/terraform/templates/terraform/production/variables.tf +0 -2
  81. data/lib/generators/rails_template18f/terraform/templates/terraform/staging/main.tf.tt +0 -70
  82. data/lib/generators/rails_template18f/terraform/templates/terraform/staging/providers.tf +0 -23
  83. data/lib/generators/rails_template18f/terraform/templates/terraform/staging/variables.tf +0 -2
  84. data/lib/rails_template18f/generators/pipeline_options.rb +0 -18
  85. data/templates/app/assets/images/uswds.js +0 -6
  86. data/templates/config/deployment/production.yml +0 -3
  87. data/templates/config/deployment/staging.yml +0 -3
  88. data/templates/manifest.yml.tt +0 -17
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_template_18f
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Ahearn
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-12-18 00:00:00.000000000 Z
10
+ date: 2025-04-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: railties
@@ -16,28 +15,28 @@ dependencies:
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: 7.2.0
18
+ version: 8.0.1
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: 7.2.0
25
+ version: 8.0.1
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: activesupport
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: 7.2.0
32
+ version: 8.0.1
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: 7.2.0
39
+ version: 8.0.1
41
40
  - !ruby/object:Gem::Dependency
42
41
  name: thor
43
42
  requirement: !ruby/object:Gem::Requirement
@@ -100,15 +99,14 @@ dependencies:
100
99
  requirements:
101
100
  - - "~>"
102
101
  - !ruby/object:Gem::Version
103
- version: '1.40'
102
+ version: '1.43'
104
103
  type: :development
105
104
  prerelease: false
106
105
  version_requirements: !ruby/object:Gem::Requirement
107
106
  requirements:
108
107
  - - "~>"
109
108
  - !ruby/object:Gem::Version
110
- version: '1.40'
111
- description:
109
+ version: '1.43'
112
110
  email:
113
111
  - ryan.ahearn@gsa.gov
114
112
  executables:
@@ -151,6 +149,7 @@ files:
151
149
  - lib/generators/rails_template18f/cloud_gov_config/templates/spec/models/cloud_gov_config_spec.rb
152
150
  - lib/generators/rails_template18f/dap/dap_generator.rb
153
151
  - lib/generators/rails_template18f/github_actions/github_actions_generator.rb
152
+ - lib/generators/rails_template18f/github_actions/templates/github/actions/compile-assets/action.yml
154
153
  - lib/generators/rails_template18f/github_actions/templates/github/actions/run-server/action.yml
155
154
  - lib/generators/rails_template18f/github_actions/templates/github/actions/setup-languages/action.yml.tt
156
155
  - lib/generators/rails_template18f/github_actions/templates/github/actions/setup-project/action.yml.tt
@@ -158,8 +157,8 @@ files:
158
157
  - lib/generators/rails_template18f/github_actions/templates/github/workflows/assemble-ssp.yml.tt
159
158
  - lib/generators/rails_template18f/github_actions/templates/github/workflows/brakeman-analysis.yml
160
159
  - lib/generators/rails_template18f/github_actions/templates/github/workflows/dependency-scans.yml
161
- - lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt
162
- - lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml.tt
160
+ - lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml
161
+ - lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml
163
162
  - lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-daily-scan.yml.tt
164
163
  - lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-scan.yml.tt
165
164
  - lib/generators/rails_template18f/github_actions/templates/github/workflows/pa11y.yml.tt
@@ -168,13 +167,19 @@ files:
168
167
  - lib/generators/rails_template18f/github_actions/templates/github/workflows/terraform-staging.yml
169
168
  - lib/generators/rails_template18f/github_actions/templates/github/workflows/validate-ssp.yml
170
169
  - lib/generators/rails_template18f/github_actions/templates/oscal/component-definitions/github_actions/component-definition.json.tt
170
+ - lib/generators/rails_template18f/gitlab_ci/gitlab_ci_generator.rb
171
+ - lib/generators/rails_template18f/gitlab_ci/templates/gitlab-ci.yml.tt
172
+ - lib/generators/rails_template18f/gitlab_ci/templates/gitlab/node.yml.tt
173
+ - lib/generators/rails_template18f/gitlab_ci/templates/gitlab/rails.yml
174
+ - lib/generators/rails_template18f/gitlab_ci/templates/gitlab/ruby.yml
175
+ - lib/generators/rails_template18f/gitlab_ci/templates/gitlab/terraform.yml
171
176
  - lib/generators/rails_template18f/i18n/i18n_generator.rb
172
177
  - lib/generators/rails_template18f/i18n/templates/config/locales/en.yml.tt
173
178
  - lib/generators/rails_template18f/i18n/templates/config/locales/es.yml
174
179
  - lib/generators/rails_template18f/i18n/templates/config/locales/fr.yml
175
180
  - lib/generators/rails_template18f/i18n/templates/config/locales/zh.yml
176
181
  - lib/generators/rails_template18f/i18n_js/i18n_js_generator.rb
177
- - lib/generators/rails_template18f/i18n_js/templates/app/javascript/i18n.js
182
+ - lib/generators/rails_template18f/i18n_js/templates/app/javascript/i18n/index.js
178
183
  - lib/generators/rails_template18f/i18n_js/templates/config/i18n-js.yml
179
184
  - lib/generators/rails_template18f/i18n_js/templates/config/initializers/i18n_js.rb
180
185
  - lib/generators/rails_template18f/i18n_js/templates/lib/tasks/i18n.rake
@@ -190,25 +195,27 @@ files:
190
195
  - lib/generators/rails_template18f/rails_erd/templates/erdconfig
191
196
  - lib/generators/rails_template18f/sidekiq/sidekiq_generator.rb
192
197
  - lib/generators/rails_template18f/sidekiq/templates/config/initializers/redis.rb
198
+ - lib/generators/rails_template18f/terraform/templates/full_bootstrap/imports.tf.tftpl
199
+ - lib/generators/rails_template18f/terraform/templates/full_bootstrap/main.tf.tt
200
+ - lib/generators/rails_template18f/terraform/templates/sandbox_bootstrap/imports.tf.tftpl
201
+ - lib/generators/rails_template18f/terraform/templates/sandbox_bootstrap/main.tf.tt
193
202
  - lib/generators/rails_template18f/terraform/templates/terraform/README.md.tt
194
- - lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/import.sh
195
- - lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/main.tf.tt
196
- - lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/providers.tf
197
- - lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/run.sh.tt
198
- - lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/teardown_creds.sh.tt
199
- - lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/variables.tf
200
- - lib/generators/rails_template18f/terraform/templates/terraform/production/main.tf.tt
201
- - lib/generators/rails_template18f/terraform/templates/terraform/production/providers.tf
202
- - lib/generators/rails_template18f/terraform/templates/terraform/production/variables.tf
203
- - lib/generators/rails_template18f/terraform/templates/terraform/staging/main.tf.tt
204
- - lib/generators/rails_template18f/terraform/templates/terraform/staging/providers.tf
205
- - lib/generators/rails_template18f/terraform/templates/terraform/staging/variables.tf
203
+ - lib/generators/rails_template18f/terraform/templates/terraform/app.tf.tt
204
+ - lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/apply.sh
205
+ - lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/templates/backend_config.tftpl
206
+ - lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/templates/bot_secrets.tftpl
207
+ - lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/users.auto.tfvars
208
+ - lib/generators/rails_template18f/terraform/templates/terraform/main.tf.tt
209
+ - lib/generators/rails_template18f/terraform/templates/terraform/production.tfvars.tt
210
+ - lib/generators/rails_template18f/terraform/templates/terraform/providers.tf.tt
211
+ - lib/generators/rails_template18f/terraform/templates/terraform/staging.tfvars.tt
212
+ - lib/generators/rails_template18f/terraform/templates/terraform/terraform.sh.tt
213
+ - lib/generators/rails_template18f/terraform/templates/terraform/variables.tf.tt
206
214
  - lib/generators/rails_template18f/terraform/terraform_generator.rb
207
215
  - lib/rails_template18f/generators.rb
208
216
  - lib/rails_template18f/generators/base.rb
209
217
  - lib/rails_template18f/generators/cloud_gov_options.rb
210
218
  - lib/rails_template18f/generators/cloud_gov_parsing.rb
211
- - lib/rails_template18f/generators/pipeline_options.rb
212
219
  - lib/rails_template18f/version.rb
213
220
  - lib/rails_template_18f.rb
214
221
  - rails-template-18f.gemspec
@@ -217,7 +224,6 @@ files:
217
224
  - template.rb
218
225
  - templates/Brewfile
219
226
  - templates/README.md.tt
220
- - templates/app/assets/images/uswds.js
221
227
  - templates/app/assets/stylesheets/uswds-components.scss
222
228
  - templates/app/assets/stylesheets/uswds-overrides/_index.scss
223
229
  - templates/app/assets/stylesheets/uswds-overrides/_override-usa-banner.scss
@@ -235,8 +241,6 @@ files:
235
241
  - templates/bin/pa11y-scan
236
242
  - templates/bin/with-server
237
243
  - templates/browserslistrc
238
- - templates/config/deployment/production.yml
239
- - templates/config/deployment/staging.yml
240
244
  - templates/config/environments/ci.rb
241
245
  - templates/config/environments/staging.rb
242
246
  - templates/doc/adr/0001-record-architecture-decisions.md.tt
@@ -252,9 +256,8 @@ files:
252
256
  - templates/githooks/pre-commit
253
257
  - templates/lib/tasks/cf.rake
254
258
  - templates/lib/tasks/scanning.rake
255
- - templates/manifest.yml.tt
256
259
  - templates/pa11y.js
257
- - templates/pa11yci.js
260
+ - templates/pa11yci.js.tt
258
261
  - templates/zap.conf
259
262
  homepage: https://github.com/18f/rails-template
260
263
  licenses: []
@@ -263,7 +266,6 @@ metadata:
263
266
  homepage_uri: https://github.com/18f/rails-template
264
267
  source_code_uri: https://github.com/18f/rails-template
265
268
  changelog_uri: https://github.com/18f/rails-template/blob/main/CHANGELOG.md
266
- post_install_message:
267
269
  rdoc_options: []
268
270
  require_paths:
269
271
  - lib
@@ -271,15 +273,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
271
273
  requirements:
272
274
  - - ">="
273
275
  - !ruby/object:Gem::Version
274
- version: 2.7.5
276
+ version: 3.2.0
275
277
  required_rubygems_version: !ruby/object:Gem::Requirement
276
278
  requirements:
277
279
  - - ">="
278
280
  - !ruby/object:Gem::Version
279
281
  version: '0'
280
282
  requirements: []
281
- rubygems_version: 3.5.11
282
- signing_key:
283
+ rubygems_version: 3.6.2
283
284
  specification_version: 4
284
285
  summary: Generators for creating an 18F-flavored Rails app
285
286
  test_files: []
@@ -1,50 +0,0 @@
1
- name: Deploy Production
2
-
3
- on:
4
- push:
5
- branches: [ production ]
6
- paths-ignore:
7
- - 'doc/**'
8
- - 'README.md'
9
-
10
- permissions:
11
- contents: read
12
- pull-requests: write
13
-
14
- jobs:
15
- deploy:
16
- name: Deploy to production
17
- runs-on: ubuntu-latest
18
- environment: production
19
- env:
20
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21
- steps:
22
- - uses: actions/checkout@v4
23
- <% if terraform? %>
24
- - name: Terraform apply
25
- uses: dflook/terraform-apply@v1
26
- env:
27
- TF_VAR_cf_user: ${{ secrets.CF_USERNAME }}
28
- TF_VAR_cf_password: ${{ secrets.CF_PASSWORD }}
29
- with:
30
- path: terraform/production
31
- backend_config: >
32
- access_key=${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
33
- secret_key=${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
34
- <% end %>
35
- - name: Set restricted egress
36
- uses: cloud-gov/cg-cli-tools@main
37
- with:
38
- cf_username: ${{ secrets.CF_USERNAME }}
39
- cf_password: ${{ secrets.CF_PASSWORD }}
40
- cf_org: <%= cloud_gov_organization %>
41
- cf_space: <%= cloud_gov_production_space %>
42
- cf_command: bind-security-group trusted_local_networks_egress $INPUT_CF_ORG --space $INPUT_CF_SPACE
43
- - name: Deploy app
44
- uses: cloud-gov/cg-cli-tools@main
45
- with:
46
- cf_username: ${{ secrets.CF_USERNAME }}
47
- cf_password: ${{ secrets.CF_PASSWORD }}
48
- cf_org: <%= cloud_gov_organization %>
49
- cf_space: <%= cloud_gov_production_space %>
50
- cf_command: push --vars-file config/deployment/production.yml --var rails_master_key="${{ secrets.RAILS_MASTER_KEY }}" --strategy rolling
@@ -1,50 +0,0 @@
1
- name: Deploy Staging
2
-
3
- on:
4
- push:
5
- branches: [ main ]
6
- paths-ignore:
7
- - 'doc/**'
8
- - 'README.md'
9
-
10
- permissions:
11
- contents: read
12
- pull-requests: write
13
-
14
- jobs:
15
- deploy:
16
- name: Deploy to staging
17
- runs-on: ubuntu-latest
18
- environment: staging
19
- env:
20
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21
- steps:
22
- - uses: actions/checkout@v4
23
- <% if terraform? %>
24
- - name: Terraform apply
25
- uses: dflook/terraform-apply@v1
26
- env:
27
- TF_VAR_cf_user: ${{ secrets.CF_USERNAME }}
28
- TF_VAR_cf_password: ${{ secrets.CF_PASSWORD }}
29
- with:
30
- path: terraform/staging
31
- backend_config: >
32
- access_key=${{ secrets.TERRAFORM_STATE_ACCESS_KEY }}
33
- secret_key=${{ secrets.TERRAFORM_STATE_SECRET_ACCESS_KEY }}
34
- <% end %>
35
- - name: Set restricted egress
36
- uses: cloud-gov/cg-cli-tools@main
37
- with:
38
- cf_username: ${{ secrets.CF_USERNAME }}
39
- cf_password: ${{ secrets.CF_PASSWORD }}
40
- cf_org: <%= cloud_gov_organization %>
41
- cf_space: <%= cloud_gov_staging_space %>
42
- cf_command: bind-security-group trusted_local_networks_egress $INPUT_CF_ORG --space $INPUT_CF_SPACE
43
- - name: Deploy app
44
- uses: cloud-gov/cg-cli-tools@main
45
- with:
46
- cf_username: ${{ secrets.CF_USERNAME }}
47
- cf_password: ${{ secrets.CF_PASSWORD }}
48
- cf_org: <%= cloud_gov_organization %>
49
- cf_space: <%= cloud_gov_staging_space %>
50
- cf_command: push --vars-file config/deployment/staging.yml --var rails_master_key="${{ secrets.RAILS_MASTER_KEY }}" --strategy rolling
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- read -p "Are you sure you want to import terraform state (y/n)? " verify
4
-
5
- if [[ $verify == "y" ]]; then
6
- echo "Importing bootstrap state"
7
- ./run.sh init
8
- ./run.sh import module.s3.cloudfoundry_service_instance.bucket TKTK
9
- ./run.sh import cloudfoundry_service_key.bucket_creds TKTK
10
- ./run.sh plan
11
- else
12
- echo "Not importing bootstrap state"
13
- fi
@@ -1,22 +0,0 @@
1
- locals {
2
- s3_service_name = "<%= app_name %>-terraform-state"
3
- }
4
-
5
- module "s3" {
6
- source = "github.com/gsa-tts/terraform-cloudgov//s3?ref=v1.0.0"
7
-
8
- cf_org_name = "<%= cloud_gov_organization %>"
9
- cf_space_name = "<%= cloud_gov_production_space %>-mgmt"
10
- name = local.s3_service_name<% if cloud_gov_organization == "sandbox-gsa" %>
11
- s3_plan_name = "basic-sandbox"<% end %>
12
- }
13
-
14
- resource "cloudfoundry_service_key" "bucket_creds" {
15
- name = "${local.s3_service_name}-access"
16
- service_instance = module.s3.bucket_id
17
- }
18
-
19
- output "bucket_credentials" {
20
- value = cloudfoundry_service_key.bucket_creds.credentials
21
- sensitive = true
22
- }
@@ -1,16 +0,0 @@
1
- terraform {
2
- required_version = "~> 1.0"
3
- required_providers {
4
- cloudfoundry = {
5
- source = "cloudfoundry-community/cloudfoundry"
6
- version = "0.53.1"
7
- }
8
- }
9
- }
10
-
11
- provider "cloudfoundry" {
12
- api_url = "https://api.fr.cloud.gov"
13
- user = var.cf_user
14
- password = var.cf_password
15
- app_logs_max = 30
16
- }
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- if ! command -v jq &> /dev/null
4
- then
5
- echo "jq must be installed. Run 'brew bundle' to install everything in the Brewfile"
6
- exit 1
7
- fi
8
- if ! command -v terraform &> /dev/null
9
- then
10
- echo "terraform must be installed before running this script"
11
- exit 1
12
- fi
13
-
14
- dig_output () {
15
- dig_result=`cat terraform.tfstate | jq -r ".outputs.bucket_credentials.value.$1"`
16
- }
17
-
18
- if [[ ! -f "secrets.auto.tfvars" ]]; then
19
- cf target -s <%= cloud_gov_production_space %>-mgmt || cf create-space <%= cloud_gov_production_space %>-mgmt && cf disallow-space-ssh <%= cloud_gov_production_space %>-mgmt
20
- ../../bin/ops/create_service_account.sh -s <%= cloud_gov_production_space %>-mgmt -u config-bootstrap-deployer > secrets.auto.tfvars
21
- fi
22
-
23
- if [[ $# -gt 0 ]]; then
24
- echo "Running terraform $@"
25
- terraform $@
26
- if [[ -f terraform.tfstate ]]; then
27
- echo
28
- echo "Credentials for terraform state bucket:"
29
- dig_output "bucket"
30
- echo "BUCKET=$dig_result"
31
- dig_output "access_key_id"
32
- echo "AWS_ACCESS_KEY_ID=$dig_result"
33
- dig_output "secret_access_key"
34
- echo "AWS_SECRET_ACCESS_KEY=$dig_result"
35
- dig_output "region"
36
- echo "AWS_REGION=$dig_result"
37
- fi
38
- else
39
- echo "Not running terraform"
40
- fi
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- ../../bin/ops/destroy_service_account.sh -s <%= cloud_gov_production_space %>-mgmt -u config-bootstrap-deployer
4
-
5
- rm secrets.auto.tfvars
@@ -1,2 +0,0 @@
1
- variable "cf_password" {}
2
- variable "cf_user" {}
@@ -1,90 +0,0 @@
1
- locals {
2
- cf_org_name = "<%= cloud_gov_organization %>"
3
- cf_space_name = "<%= cloud_gov_production_space %>"
4
- env = "production"
5
- app_name = "<%= app_name %>"
6
- }
7
-
8
- module "app_space" {
9
- source = "github.com/gsa-tts/terraform-cloudgov//cg_space?ref=v1.1.0"
10
-
11
- cf_org_name = local.cf_org_name
12
- cf_space_name = local.cf_space_name
13
- deployers = [var.cf_user]
14
- # developers should include any users that will potentially need to run `cf ssh` on the app
15
- developers = []
16
- }
17
-
18
- module "database" {
19
- source = "github.com/gsa-tts/terraform-cloudgov//database?ref=v1.1.0"
20
-
21
- cf_org_name = local.cf_org_name
22
- cf_space_name = local.cf_space_name
23
- name = "${local.app_name}-rds-${local.env}"
24
- rds_plan_name = "TKTK-production-rds-plan"
25
- # depends_on line is needed only for initial creation and destruction. It should be commented out for updates to prevent unwanted cascading effects
26
- depends_on = [module.app_space]
27
- }
28
- <% if has_active_job? %>
29
- module "redis" {
30
- source = "github.com/gsa-tts/terraform-cloudgov//redis?ref=v1.1.0"
31
-
32
- cf_org_name = local.cf_org_name
33
- cf_space_name = local.cf_space_name
34
- name = "${local.app_name}-redis-${local.env}"
35
- redis_plan_name = "TKTK-production-redis-plan"
36
- # depends_on line is needed only for initial creation and destruction. It should be commented out for updates to prevent unwanted cascading effects
37
- depends_on = [module.app_space]
38
- }
39
- <% end %>
40
- <% if has_active_storage? %>
41
- module "s3" {
42
- source = "github.com/gsa-tts/terraform-cloudgov//s3?ref=v1.1.0"
43
-
44
- cf_org_name = local.cf_org_name
45
- cf_space_name = local.cf_space_name
46
- name = "${local.app_name}-s3-${local.env}"<% if cloud_gov_organization == "sandbox-gsa" %>
47
- s3_plan_name = "basic-sandbox"<% end %>
48
- # depends_on line is needed only for initial creation and destruction. It should be commented out for updates to prevent unwanted cascading effects
49
- depends_on = [module.app_space]
50
- }
51
-
52
- ###########################################################################
53
- # The following lines need to be commented out for the initial `terraform apply`
54
- # It can be re-enabled after:
55
- # 1) the app has first been deployed
56
- # 2) Your organization has sufficient memory. Each clamav app requires 3GB
57
- ###########################################################################
58
- # module "clamav" {
59
- # source = "github.com/gsa-tts/terraform-cloudgov//clamav?ref=v1.1.0"
60
- #
61
- # cf_org_name = local.cf_org_name
62
- # cf_space_name = local.cf_space_name
63
- # app_name_or_id = "${local.app_name}-${local.env}"
64
- # name = "${local.app_name}-clamapi-${local.env}"
65
- # clamav_image = "ghcr.io/gsa-tts/clamav-rest/clamav:20240602"
66
- # max_file_size = "30M"
67
- # # depends_on line is needed only for initial creation and destruction. It should be commented out for updates to prevent unwanted cascading effects
68
- # depends_on = [module.app_space]
69
- # }
70
- <% end %>
71
-
72
- ###########################################################################
73
- # The following lines need to be commented out for the initial `terraform apply`
74
- # It can be re-enabled after:
75
- # 1) the app has first been deployed
76
- # 2) the route has been manually created by an OrgManager:
77
- # `cf create-domain <%= cloud_gov_organization %> TKTK-production-domain-name`
78
- ###########################################################################
79
- # module "domain" {
80
- # source = "github.com/gsa-tts/terraform-cloudgov//domain?ref=v1.1.0"
81
- #
82
- # cf_org_name = local.cf_org_name
83
- # cf_space_name = local.cf_space_name
84
- # app_name_or_id = "${local.app_name}-${local.env}"
85
- # cdn_plan_name = "domain"
86
- # domain_name = "TKTK-production-domain-name"
87
- # host_name = "TKTK-production-hostname (optional)"
88
- # # depends_on line is needed only for initial creation and destruction. It should be commented out for updates to prevent unwanted cascading effects
89
- # depends_on = [module.app_space]
90
- # }
@@ -1,23 +0,0 @@
1
- terraform {
2
- required_version = "~> 1.0"
3
- required_providers {
4
- cloudfoundry = {
5
- source = "cloudfoundry-community/cloudfoundry"
6
- version = "0.53.1"
7
- }
8
- }
9
-
10
- backend "s3" {
11
- bucket = "TKTK-s3-bucket"
12
- key = "terraform.tfstate.prod"
13
- encrypt = "true"
14
- region = "us-gov-west-1"
15
- }
16
- }
17
-
18
- provider "cloudfoundry" {
19
- api_url = "https://api.fr.cloud.gov"
20
- user = var.cf_user
21
- password = var.cf_password
22
- app_logs_max = 30
23
- }
@@ -1,2 +0,0 @@
1
- variable "cf_password" {}
2
- variable "cf_user" {}
@@ -1,70 +0,0 @@
1
- locals {
2
- cf_org_name = "<%= cloud_gov_organization %>"
3
- cf_space_name = "<%= cloud_gov_staging_space %>"
4
- env = "staging"
5
- app_name = "<%= app_name %>"
6
- }
7
-
8
- module "app_space" {
9
- source = "github.com/gsa-tts/terraform-cloudgov//cg_space?ref=v1.1.0"
10
-
11
- cf_org_name = local.cf_org_name
12
- cf_space_name = local.cf_space_name
13
- deployers = [var.cf_user]
14
- # developers should include any users that will potentially need to run `cf ssh` on the app
15
- developers = []
16
- }
17
-
18
- module "database" {
19
- source = "github.com/gsa-tts/terraform-cloudgov//database?ref=v1.1.0"
20
-
21
- cf_org_name = local.cf_org_name
22
- cf_space_name = local.cf_space_name
23
- name = "${local.app_name}-rds-${local.env}"
24
- rds_plan_name = "micro-psql"
25
- # depends_on line is needed only for initial creation and destruction. It should be commented out for updates to prevent unwanted cascading effects
26
- depends_on = [module.app_space]
27
- }
28
- <% if has_active_job? %>
29
- module "redis" {
30
- source = "github.com/gsa-tts/terraform-cloudgov//redis?ref=v1.1.0"
31
-
32
- cf_org_name = local.cf_org_name
33
- cf_space_name = local.cf_space_name
34
- name = "${local.app_name}-redis-${local.env}"
35
- redis_plan_name = "redis-dev"
36
- # depends_on line is needed only for initial creation and destruction. It should be commented out for updates to prevent unwanted cascading effects
37
- depends_on = [module.app_space]
38
- }
39
- <% end %>
40
- <% if has_active_storage? %>
41
- module "s3" {
42
- source = "github.com/gsa-tts/terraform-cloudgov//s3?ref=v1.1.0"
43
-
44
- cf_org_name = local.cf_org_name
45
- cf_space_name = local.cf_space_name
46
- name = "${local.app_name}-s3-${local.env}"<% if cloud_gov_organization == "sandbox-gsa" %>
47
- s3_plan_name = "basic-sandbox"<% end %>
48
- # depends_on line is needed only for initial creation and destruction. It should be commented out for updates to prevent unwanted cascading effects
49
- depends_on = [module.app_space]
50
- }
51
-
52
- ###########################################################################
53
- # The following lines need to be commented out for the initial `terraform apply`
54
- # It can be re-enabled after:
55
- # 1) the app has first been deployed
56
- # 2) Your organization has sufficient memory. Each clamav app requires 3GB
57
- ###########################################################################
58
- # module "clamav" {
59
- # source = "github.com/gsa-tts/terraform-cloudgov//clamav?ref=v1.1.0"
60
- #
61
- # cf_org_name = local.cf_org_name
62
- # cf_space_name = local.cf_space_name
63
- # app_name_or_id = "${local.app_name}-${local.env}"
64
- # name = "${local.app_name}-clamapi-${local.env}"
65
- # clamav_image = "ghcr.io/gsa-tts/clamav-rest/clamav:20240602"
66
- # max_file_size = "30M"
67
- # # depends_on line is needed only for initial creation and destruction. It should be commented out for updates to prevent unwanted cascading effects
68
- # depends_on = [module.app_space]
69
- # }
70
- <% end %>
@@ -1,23 +0,0 @@
1
- terraform {
2
- required_version = "~> 1.0"
3
- required_providers {
4
- cloudfoundry = {
5
- source = "cloudfoundry-community/cloudfoundry"
6
- version = "0.53.1"
7
- }
8
- }
9
-
10
- backend "s3" {
11
- bucket = "TKTK-s3-bucket"
12
- key = "terraform.tfstate.stage"
13
- encrypt = "true"
14
- region = "us-gov-west-1"
15
- }
16
- }
17
-
18
- provider "cloudfoundry" {
19
- api_url = "https://api.fr.cloud.gov"
20
- user = var.cf_user
21
- password = var.cf_password
22
- app_logs_max = 30
23
- }
@@ -1,2 +0,0 @@
1
- variable "cf_password" {}
2
- variable "cf_user" {}
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RailsTemplate18f
4
- module Generators
5
- module PipelineOptions
6
- extend ActiveSupport::Concern
7
- include CloudGovOptions
8
-
9
- included do
10
- class_option :terraform, type: :boolean, desc: "Generate actions for planning and applying terraform"
11
- end
12
-
13
- def terraform?
14
- options[:terraform].nil? ? terraform_dir_exists? : options[:terraform]
15
- end
16
- end
17
- end
18
- end
@@ -1,6 +0,0 @@
1
- // Glue to find USWDS images with the `image_tag` helper
2
-
3
- //= link @uswds/uswds/dist/img/us_flag_small.png
4
- //= link @uswds/uswds/dist/img/icon-dot-gov.svg
5
- //= link @uswds/uswds/dist/img/icon-https.svg
6
- //= link @uswds/uswds/dist/img/usa-icons/close.svg
@@ -1,3 +0,0 @@
1
- env: production
2
- web_instances: 2
3
- web_memory: 512M