rails_template_18f 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +71 -70
- data/README.md +11 -16
- data/lib/generators/rails_template18f/active_storage/active_storage_generator.rb +7 -6
- data/lib/generators/rails_template18f/circleci/circleci_generator.rb +28 -27
- data/lib/generators/rails_template18f/circleci/templates/Dockerfile.ci.tt +0 -1
- data/lib/generators/rails_template18f/circleci/templates/circleci/config.yml.tt +152 -158
- data/lib/generators/rails_template18f/github_actions/github_actions_generator.rb +31 -30
- data/lib/generators/rails_template18f/github_actions/templates/github/actions/compile-assets/action.yml +50 -0
- data/lib/generators/rails_template18f/github_actions/templates/github/actions/setup-project/action.yml.tt +4 -8
- data/lib/generators/rails_template18f/github_actions/templates/github/dependabot.yml.tt +2 -4
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml +72 -0
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml +72 -0
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-daily-scan.yml.tt +10 -1
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-scan.yml.tt +1 -1
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/pa11y.yml.tt +2 -2
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/terraform-production.yml +46 -3
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/terraform-staging.yml +46 -3
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/validate-ssp.yml +2 -2
- data/lib/generators/rails_template18f/i18n_js/i18n_js_generator.rb +12 -20
- data/lib/generators/rails_template18f/i18n_js/templates/app/javascript/i18n/index.js +11 -0
- data/lib/generators/rails_template18f/i18n_js/templates/config/i18n-js.yml +4 -0
- data/lib/generators/rails_template18f/i18n_js/templates/config/initializers/i18n_js.rb +5 -0
- data/lib/generators/rails_template18f/i18n_js/templates/lib/tasks/i18n.rake +8 -7
- data/lib/generators/rails_template18f/newrelic/newrelic_generator.rb +4 -2
- data/lib/generators/rails_template18f/public_egress/public_egress_generator.rb +168 -0
- data/lib/generators/rails_template18f/sidekiq/sidekiq_generator.rb +8 -17
- data/lib/generators/rails_template18f/terraform/templates/full_bootstrap/imports.tf.tftpl +25 -0
- data/lib/generators/rails_template18f/terraform/templates/full_bootstrap/main.tf.tt +159 -0
- data/lib/generators/rails_template18f/terraform/templates/sandbox_bootstrap/imports.tf.tftpl +10 -0
- data/lib/generators/rails_template18f/terraform/templates/sandbox_bootstrap/main.tf.tt +117 -0
- data/lib/generators/rails_template18f/terraform/templates/terraform/README.md.tt +77 -93
- data/lib/generators/rails_template18f/terraform/templates/terraform/app.tf.tt +63 -0
- data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/apply.sh +15 -0
- data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/templates/backend_config.tftpl +8 -0
- data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/templates/bot_secrets.tftpl +5 -0
- data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/users.auto.tfvars +5 -0
- data/lib/generators/rails_template18f/terraform/templates/terraform/main.tf.tt +106 -0
- data/lib/generators/rails_template18f/terraform/templates/terraform/production.tfvars.tt +10 -0
- data/lib/generators/rails_template18f/terraform/templates/terraform/providers.tf.tt +32 -0
- data/lib/generators/rails_template18f/terraform/templates/terraform/sandbox_bot/main.tf +74 -0
- data/lib/generators/rails_template18f/terraform/templates/terraform/sandbox_bot/run.sh +17 -0
- data/lib/generators/rails_template18f/terraform/templates/terraform/staging.tfvars.tt +8 -0
- data/lib/generators/rails_template18f/terraform/templates/terraform/terraform.sh.tt +135 -0
- data/lib/generators/rails_template18f/terraform/templates/terraform/variables.tf.tt +99 -0
- data/lib/generators/rails_template18f/terraform/terraform_generator.rb +13 -4
- data/lib/rails_template18f/generators/base.rb +7 -0
- data/lib/rails_template18f/generators/cloud_gov_options.rb +10 -27
- data/lib/rails_template18f/generators/cloud_gov_parsing.rb +41 -0
- data/lib/rails_template18f/generators.rb +1 -1
- data/lib/rails_template18f/version.rb +1 -1
- data/rails-template-18f.gemspec +4 -4
- data/railsrc +4 -2
- data/railsrc-hotwire +4 -2
- data/template.rb +61 -71
- data/templates/README.md.tt +21 -8
- data/templates/app/assets/stylesheets/uswds-settings.scss +3 -2
- data/templates/app/views/application/_header.html.erb +1 -1
- data/templates/app/views/application/_usa_banner.html.erb +3 -3
- data/templates/bin/ops/create_service_account.sh.tt +30 -9
- data/templates/bin/ops/destroy_service_account.sh.tt +3 -6
- data/templates/browserslistrc +1 -2
- data/templates/doc/compliance/TODO.md +1 -4
- metadata +34 -28
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml.tt +0 -42
- data/lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml.tt +0 -42
- data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/import.sh +0 -13
- data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/main.tf.tt +0 -22
- data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/providers.tf +0 -16
- data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/run.sh.tt +0 -39
- data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/teardown_creds.sh.tt +0 -5
- data/lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/variables.tf +0 -2
- data/lib/generators/rails_template18f/terraform/templates/terraform/production/main.tf.tt +0 -70
- data/lib/generators/rails_template18f/terraform/templates/terraform/production/providers.tf.tt +0 -23
- data/lib/generators/rails_template18f/terraform/templates/terraform/production/variables.tf +0 -2
- data/lib/generators/rails_template18f/terraform/templates/terraform/staging/main.tf.tt +0 -52
- data/lib/generators/rails_template18f/terraform/templates/terraform/staging/providers.tf.tt +0 -23
- data/lib/generators/rails_template18f/terraform/templates/terraform/staging/variables.tf +0 -2
- data/lib/rails_template18f/generators/pipeline_options.rb +0 -18
- data/templates/app/assets/images/uswds.js +0 -6
- data/templates/config/deployment/production.yml +0 -3
- data/templates/config/deployment/staging.yml +0 -3
- data/templates/manifest.yml.tt +0 -17
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:
|
4
|
+
version: 2.0.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:
|
11
|
+
date: 2025-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 8.0.1
|
20
20
|
type: :runtime
|
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:
|
26
|
+
version: 8.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 8.0.1
|
34
34
|
type: :runtime
|
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:
|
40
|
+
version: 8.0.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: thor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '1.
|
103
|
+
version: '1.43'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '1.
|
110
|
+
version: '1.43'
|
111
111
|
description:
|
112
112
|
email:
|
113
113
|
- ryan.ahearn@gsa.gov
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- lib/generators/rails_template18f/cloud_gov_config/templates/spec/models/cloud_gov_config_spec.rb
|
152
152
|
- lib/generators/rails_template18f/dap/dap_generator.rb
|
153
153
|
- lib/generators/rails_template18f/github_actions/github_actions_generator.rb
|
154
|
+
- lib/generators/rails_template18f/github_actions/templates/github/actions/compile-assets/action.yml
|
154
155
|
- lib/generators/rails_template18f/github_actions/templates/github/actions/run-server/action.yml
|
155
156
|
- lib/generators/rails_template18f/github_actions/templates/github/actions/setup-languages/action.yml.tt
|
156
157
|
- lib/generators/rails_template18f/github_actions/templates/github/actions/setup-project/action.yml.tt
|
@@ -158,8 +159,8 @@ files:
|
|
158
159
|
- lib/generators/rails_template18f/github_actions/templates/github/workflows/assemble-ssp.yml.tt
|
159
160
|
- lib/generators/rails_template18f/github_actions/templates/github/workflows/brakeman-analysis.yml
|
160
161
|
- 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
|
162
|
-
- lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml
|
162
|
+
- lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-production.yml
|
163
|
+
- lib/generators/rails_template18f/github_actions/templates/github/workflows/deploy-staging.yml
|
163
164
|
- lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-daily-scan.yml.tt
|
164
165
|
- lib/generators/rails_template18f/github_actions/templates/github/workflows/owasp-scan.yml.tt
|
165
166
|
- lib/generators/rails_template18f/github_actions/templates/github/workflows/pa11y.yml.tt
|
@@ -174,6 +175,9 @@ files:
|
|
174
175
|
- lib/generators/rails_template18f/i18n/templates/config/locales/fr.yml
|
175
176
|
- lib/generators/rails_template18f/i18n/templates/config/locales/zh.yml
|
176
177
|
- lib/generators/rails_template18f/i18n_js/i18n_js_generator.rb
|
178
|
+
- lib/generators/rails_template18f/i18n_js/templates/app/javascript/i18n/index.js
|
179
|
+
- lib/generators/rails_template18f/i18n_js/templates/config/i18n-js.yml
|
180
|
+
- lib/generators/rails_template18f/i18n_js/templates/config/initializers/i18n_js.rb
|
177
181
|
- lib/generators/rails_template18f/i18n_js/templates/lib/tasks/i18n.rake
|
178
182
|
- lib/generators/rails_template18f/newrelic/newrelic_generator.rb
|
179
183
|
- lib/generators/rails_template18f/newrelic/templates/config/newrelic.yml.tt
|
@@ -182,28 +186,34 @@ files:
|
|
182
186
|
- lib/generators/rails_template18f/oscal/templates/bin/trestle.tt
|
183
187
|
- lib/generators/rails_template18f/oscal/templates/doc/compliance/oscal/trestle-config.yaml.tt
|
184
188
|
- lib/generators/rails_template18f/oscal/templates/github/actions/trestle-cmd/action.yml.tt
|
189
|
+
- lib/generators/rails_template18f/public_egress/public_egress_generator.rb
|
185
190
|
- lib/generators/rails_template18f/rails_erd/rails_erd_generator.rb
|
186
191
|
- lib/generators/rails_template18f/rails_erd/templates/erdconfig
|
187
192
|
- lib/generators/rails_template18f/sidekiq/sidekiq_generator.rb
|
188
193
|
- lib/generators/rails_template18f/sidekiq/templates/config/initializers/redis.rb
|
194
|
+
- lib/generators/rails_template18f/terraform/templates/full_bootstrap/imports.tf.tftpl
|
195
|
+
- lib/generators/rails_template18f/terraform/templates/full_bootstrap/main.tf.tt
|
196
|
+
- lib/generators/rails_template18f/terraform/templates/sandbox_bootstrap/imports.tf.tftpl
|
197
|
+
- lib/generators/rails_template18f/terraform/templates/sandbox_bootstrap/main.tf.tt
|
189
198
|
- lib/generators/rails_template18f/terraform/templates/terraform/README.md.tt
|
190
|
-
- lib/generators/rails_template18f/terraform/templates/terraform/
|
191
|
-
- lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/
|
192
|
-
- lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/
|
193
|
-
- lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/
|
194
|
-
- lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/
|
195
|
-
- lib/generators/rails_template18f/terraform/templates/terraform/
|
196
|
-
- lib/generators/rails_template18f/terraform/templates/terraform/production
|
197
|
-
- lib/generators/rails_template18f/terraform/templates/terraform/
|
198
|
-
- lib/generators/rails_template18f/terraform/templates/terraform/
|
199
|
-
- lib/generators/rails_template18f/terraform/templates/terraform/
|
200
|
-
- lib/generators/rails_template18f/terraform/templates/terraform/staging
|
201
|
-
- lib/generators/rails_template18f/terraform/templates/terraform/
|
199
|
+
- lib/generators/rails_template18f/terraform/templates/terraform/app.tf.tt
|
200
|
+
- lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/apply.sh
|
201
|
+
- lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/templates/backend_config.tftpl
|
202
|
+
- lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/templates/bot_secrets.tftpl
|
203
|
+
- lib/generators/rails_template18f/terraform/templates/terraform/bootstrap/users.auto.tfvars
|
204
|
+
- lib/generators/rails_template18f/terraform/templates/terraform/main.tf.tt
|
205
|
+
- lib/generators/rails_template18f/terraform/templates/terraform/production.tfvars.tt
|
206
|
+
- lib/generators/rails_template18f/terraform/templates/terraform/providers.tf.tt
|
207
|
+
- lib/generators/rails_template18f/terraform/templates/terraform/sandbox_bot/main.tf
|
208
|
+
- lib/generators/rails_template18f/terraform/templates/terraform/sandbox_bot/run.sh
|
209
|
+
- lib/generators/rails_template18f/terraform/templates/terraform/staging.tfvars.tt
|
210
|
+
- lib/generators/rails_template18f/terraform/templates/terraform/terraform.sh.tt
|
211
|
+
- lib/generators/rails_template18f/terraform/templates/terraform/variables.tf.tt
|
202
212
|
- lib/generators/rails_template18f/terraform/terraform_generator.rb
|
203
213
|
- lib/rails_template18f/generators.rb
|
204
214
|
- lib/rails_template18f/generators/base.rb
|
205
215
|
- lib/rails_template18f/generators/cloud_gov_options.rb
|
206
|
-
- lib/rails_template18f/generators/
|
216
|
+
- lib/rails_template18f/generators/cloud_gov_parsing.rb
|
207
217
|
- lib/rails_template18f/version.rb
|
208
218
|
- lib/rails_template_18f.rb
|
209
219
|
- rails-template-18f.gemspec
|
@@ -212,7 +222,6 @@ files:
|
|
212
222
|
- template.rb
|
213
223
|
- templates/Brewfile
|
214
224
|
- templates/README.md.tt
|
215
|
-
- templates/app/assets/images/uswds.js
|
216
225
|
- templates/app/assets/stylesheets/uswds-components.scss
|
217
226
|
- templates/app/assets/stylesheets/uswds-overrides/_index.scss
|
218
227
|
- templates/app/assets/stylesheets/uswds-overrides/_override-usa-banner.scss
|
@@ -230,8 +239,6 @@ files:
|
|
230
239
|
- templates/bin/pa11y-scan
|
231
240
|
- templates/bin/with-server
|
232
241
|
- templates/browserslistrc
|
233
|
-
- templates/config/deployment/production.yml
|
234
|
-
- templates/config/deployment/staging.yml
|
235
242
|
- templates/config/environments/ci.rb
|
236
243
|
- templates/config/environments/staging.rb
|
237
244
|
- templates/doc/adr/0001-record-architecture-decisions.md.tt
|
@@ -247,7 +254,6 @@ files:
|
|
247
254
|
- templates/githooks/pre-commit
|
248
255
|
- templates/lib/tasks/cf.rake
|
249
256
|
- templates/lib/tasks/scanning.rake
|
250
|
-
- templates/manifest.yml.tt
|
251
257
|
- templates/pa11y.js
|
252
258
|
- templates/pa11yci.js
|
253
259
|
- templates/zap.conf
|
@@ -266,7 +272,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
266
272
|
requirements:
|
267
273
|
- - ">="
|
268
274
|
- !ruby/object:Gem::Version
|
269
|
-
version: 2.
|
275
|
+
version: 3.2.0
|
270
276
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
271
277
|
requirements:
|
272
278
|
- - ">="
|
@@ -1,42 +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: Deploy app
|
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: push --vars-file config/deployment/production.yml --var rails_master_key="${{ secrets.RAILS_MASTER_KEY }}" --strategy rolling
|
@@ -1,42 +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: Deploy app
|
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: 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 %>"
|
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,39 +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
|
-
../../bin/ops/create_service_account.sh -s <%= cloud_gov_production_space %> -u config-bootstrap-deployer > secrets.auto.tfvars
|
20
|
-
fi
|
21
|
-
|
22
|
-
if [[ $# -gt 0 ]]; then
|
23
|
-
echo "Running terraform $@"
|
24
|
-
terraform $@
|
25
|
-
if [[ -f terraform.tfstate ]]; then
|
26
|
-
echo
|
27
|
-
echo "Credentials for terraform state bucket:"
|
28
|
-
dig_output "bucket"
|
29
|
-
echo "BUCKET=$dig_result"
|
30
|
-
dig_output "access_key_id"
|
31
|
-
echo "AWS_ACCESS_KEY_ID=$dig_result"
|
32
|
-
dig_output "secret_access_key"
|
33
|
-
echo "AWS_SECRET_ACCESS_KEY=$dig_result"
|
34
|
-
dig_output "region"
|
35
|
-
echo "AWS_REGION=$dig_result"
|
36
|
-
fi
|
37
|
-
else
|
38
|
-
echo "Not running terraform"
|
39
|
-
fi
|
@@ -1,70 +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 "database" {
|
9
|
-
source = "github.com/gsa-tts/terraform-cloudgov//database?ref=v1.0.0"
|
10
|
-
|
11
|
-
cf_org_name = local.cf_org_name
|
12
|
-
cf_space_name = local.cf_space_name
|
13
|
-
name = "${local.app_name}-rds-${local.env}"
|
14
|
-
rds_plan_name = "TKTK-production-rds-plan"
|
15
|
-
}
|
16
|
-
<% if has_active_job? %>
|
17
|
-
module "redis" {
|
18
|
-
source = "github.com/gsa-tts/terraform-cloudgov//redis?ref=v1.0.0"
|
19
|
-
|
20
|
-
cf_org_name = local.cf_org_name
|
21
|
-
cf_space_name = local.cf_space_name
|
22
|
-
name = "${local.app_name}-redis-${local.env}"
|
23
|
-
redis_plan_name = "TKTK-production-redis-plan"
|
24
|
-
}
|
25
|
-
<% end %>
|
26
|
-
<% if has_active_storage? %>
|
27
|
-
module "s3" {
|
28
|
-
source = "github.com/gsa-tts/terraform-cloudgov//s3?ref=v1.0.0"
|
29
|
-
|
30
|
-
cf_org_name = local.cf_org_name
|
31
|
-
cf_space_name = local.cf_space_name
|
32
|
-
name = "${local.app_name}-s3-${local.env}"<% if cloud_gov_organization == "sandbox-gsa" %>
|
33
|
-
s3_plan_name = "basic-sandbox"<% end %>
|
34
|
-
}
|
35
|
-
|
36
|
-
###########################################################################
|
37
|
-
# The following lines need to be commented out for the initial `terraform apply`
|
38
|
-
# It can be re-enabled after:
|
39
|
-
# 1) the app has first been deployed
|
40
|
-
# 2) Your organization has sufficient memory. Each clamav app requires 3GB
|
41
|
-
###########################################################################
|
42
|
-
# module "clamav" {
|
43
|
-
# source = "github.com/gsa-tts/terraform-cloudgov//clamav?ref=v1.0.0"
|
44
|
-
#
|
45
|
-
# cf_org_name = local.cf_org_name
|
46
|
-
# cf_space_name = local.cf_space_name
|
47
|
-
# app_name_or_id = "${local.app_name}-${local.env}"
|
48
|
-
# name = "${local.app_name}-clamapi-${local.env}"
|
49
|
-
# clamav_image = "ghcr.io/gsa-tts/clamav-rest/clamav:20240602"
|
50
|
-
# max_file_size = "30M"
|
51
|
-
# }
|
52
|
-
<% end %>
|
53
|
-
|
54
|
-
###########################################################################
|
55
|
-
# The following lines need to be commented out for the initial `terraform apply`
|
56
|
-
# It can be re-enabled after:
|
57
|
-
# 1) the app has first been deployed
|
58
|
-
# 2) the route has been manually created by an OrgManager:
|
59
|
-
# `cf create-domain <%= cloud_gov_organization %> TKTK-production-domain-name`
|
60
|
-
###########################################################################
|
61
|
-
# module "domain" {
|
62
|
-
# source = "github.com/gsa-tts/terraform-cloudgov//domain?ref=v1.0.0"
|
63
|
-
#
|
64
|
-
# cf_org_name = local.cf_org_name
|
65
|
-
# cf_space_name = local.cf_space_name
|
66
|
-
# app_name_or_id = "${local.app_name}-${local.env}"
|
67
|
-
# cdn_plan_name = "domain"
|
68
|
-
# domain_name = "TKTK-production-domain-name"
|
69
|
-
# host_name = "TKTK-production-hostname (optional)"
|
70
|
-
# }
|
data/lib/generators/rails_template18f/terraform/templates/terraform/production/providers.tf.tt
DELETED
@@ -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,52 +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 "database" {
|
9
|
-
source = "github.com/gsa-tts/terraform-cloudgov//database?ref=v1.0.0"
|
10
|
-
|
11
|
-
cf_org_name = local.cf_org_name
|
12
|
-
cf_space_name = local.cf_space_name
|
13
|
-
name = "${local.app_name}-rds-${local.env}"
|
14
|
-
rds_plan_name = "micro-psql"
|
15
|
-
}
|
16
|
-
<% if has_active_job? %>
|
17
|
-
module "redis" {
|
18
|
-
source = "github.com/gsa-tts/terraform-cloudgov//redis?ref=v1.0.0"
|
19
|
-
|
20
|
-
cf_org_name = local.cf_org_name
|
21
|
-
cf_space_name = local.cf_space_name
|
22
|
-
name = "${local.app_name}-redis-${local.env}"
|
23
|
-
redis_plan_name = "redis-dev"
|
24
|
-
}
|
25
|
-
<% end %>
|
26
|
-
<% if has_active_storage? %>
|
27
|
-
module "s3" {
|
28
|
-
source = "github.com/gsa-tts/terraform-cloudgov//s3?ref=v1.0.0"
|
29
|
-
|
30
|
-
cf_org_name = local.cf_org_name
|
31
|
-
cf_space_name = local.cf_space_name
|
32
|
-
name = "${local.app_name}-s3-${local.env}"<% if cloud_gov_organization == "sandbox-gsa" %>
|
33
|
-
s3_plan_name = "basic-sandbox"<% end %>
|
34
|
-
}
|
35
|
-
|
36
|
-
###########################################################################
|
37
|
-
# The following lines need to be commented out for the initial `terraform apply`
|
38
|
-
# It can be re-enabled after:
|
39
|
-
# 1) the app has first been deployed
|
40
|
-
# 2) Your organization has sufficient memory. Each clamav app requires 3GB
|
41
|
-
###########################################################################
|
42
|
-
# module "clamav" {
|
43
|
-
# source = "github.com/gsa-tts/terraform-cloudgov//clamav?ref=v1.0.0"
|
44
|
-
#
|
45
|
-
# cf_org_name = local.cf_org_name
|
46
|
-
# cf_space_name = local.cf_space_name
|
47
|
-
# app_name_or_id = "${local.app_name}-${local.env}"
|
48
|
-
# name = "${local.app_name}-clamapi-${local.env}"
|
49
|
-
# clamav_image = "ghcr.io/gsa-tts/clamav-rest/clamav:20240602"
|
50
|
-
# max_file_size = "30M"
|
51
|
-
# }
|
52
|
-
<% 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,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
|
data/templates/manifest.yml.tt
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
---
|
2
|
-
applications:
|
3
|
-
- name: <%= app_name %>-((env))
|
4
|
-
buildpacks:
|
5
|
-
- ruby_buildpack
|
6
|
-
env:
|
7
|
-
RAILS_MASTER_KEY: ((rails_master_key))
|
8
|
-
RAILS_ENV: ((env))
|
9
|
-
RAILS_LOG_TO_STDOUT: true
|
10
|
-
RAILS_SERVE_STATIC_FILES: true
|
11
|
-
processes:
|
12
|
-
- type: web
|
13
|
-
instances: ((web_instances))
|
14
|
-
memory: ((web_memory))
|
15
|
-
command: bundle exec rake cf:on_first_instance db:migrate && bundle exec rails s -b 0.0.0.0 -p $PORT -e $RAILS_ENV
|
16
|
-
services:
|
17
|
-
- <%= app_name %>-rds-((env))
|