stack_car 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +17 -12
- data/README.md +62 -4
- data/lib/stack_car/cli.rb +134 -8
- data/lib/stack_car/version.rb +1 -1
- data/stack_car.gemspec +1 -0
- data/templates/.env.erb +14 -0
- data/templates/.gitlab/issue_templates/Bug.md +46 -0
- data/templates/.gitlab/issue_templates/Feature.md +41 -0
- data/templates/.gitlab/issue_templates/Question.md +18 -0
- data/templates/.gitlab/merge_request_templates/Bug.md +36 -0
- data/templates/.gitlab/merge_request_templates/Feature.md +36 -0
- data/templates/.gitlab-ci.yml.erb +3 -3
- data/templates/.sops.yaml.erb +3 -0
- data/templates/README.md +81 -7
- data/templates/chart/Chart.yaml.tt +15 -14
- data/templates/chart/bin/deploy +1 -1
- data/templates/chart/bin/remove +1 -1
- data/templates/chart/sample-values.yaml.tt +16 -1
- data/templates/chart/templates/_helpers.tpl.tt +1 -1
- data/templates/chart/templates/web-ing-wildcard.yaml +1 -1
- data/templates/chart/templates/web-ing.yaml +1 -1
- data/templates/database.yml.erb +0 -1
- data/templates/decrypt-secrets +22 -0
- data/templates/development.rb.erb +90 -0
- data/templates/docker-compose.yml.erb +3 -1
- data/templates/encrypt-secrets +19 -0
- data/templates/production.rb.erb +117 -0
- metadata +27 -4
- data/templates/Dockerfile.builder.erb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80132883ba506f9cf4414a46f560a2040e8843596b7a94e3d6f9baab6ae3a4d4
|
4
|
+
data.tar.gz: bb84c75a79f699e7bb04aa877eaed36f3acb9e8c8d9bf294d9f4fa7bbe579ddc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e03c8620fcd08038774e75c2cfeefa75a2bae7d42708c0240c774e3584391695a87349c50bba6b0c7b444e46e66d73b2e96b1439bbf09f0104670b83e3fb831
|
7
|
+
data.tar.gz: 3196614e6fd6ce06b7408aa292e4ae0b19ef57aa9df8643899fcf378ad840a2d4d469695010ca04948676b9a46b7b655947cbaa0bf686c59c27b3b385b73341a
|
data/.gitlab-ci.yml
CHANGED
@@ -1,17 +1,22 @@
|
|
1
|
-
|
1
|
+
stages:
|
2
|
+
- rspec
|
2
3
|
|
3
4
|
before_script:
|
4
|
-
bundle
|
5
|
+
- bundle
|
5
6
|
|
6
|
-
pages:
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
# pages:
|
8
|
+
# script:
|
9
|
+
# - bundle exec yardoc --plugin yard-thor -o public - templates/.* templates/*
|
10
|
+
# artifacts:
|
11
|
+
# paths:
|
12
|
+
# - public
|
13
|
+
# only:
|
14
|
+
# - master
|
14
15
|
|
15
|
-
|
16
|
+
rspec:
|
17
|
+
stage: rspec
|
18
|
+
image: ruby:2.3
|
16
19
|
script:
|
17
|
-
bundle exec
|
20
|
+
- bundle exec rspec
|
21
|
+
tags:
|
22
|
+
- docker
|
data/README.md
CHANGED
@@ -4,6 +4,13 @@
|
|
4
4
|
|
5
5
|
Stack Car is an opinionated set of tools around Docker and Rails. It provides convenent methods to start and stop docker-compose, to deploy with rancher and a set of templates to get a new Rails app in to docker as quickly as possible.
|
6
6
|
|
7
|
+
## Table of Contents
|
8
|
+
|
9
|
+
- [Installation](#installation)
|
10
|
+
- [Usage](#usage)
|
11
|
+
- [Development](#development)
|
12
|
+
- [Dockerizing an Application](#dockerizing-an-application)
|
13
|
+
- [Generating a Helm Chart](#generating-a-helm-chart)
|
7
14
|
|
8
15
|
## Installation
|
9
16
|
|
@@ -54,6 +61,58 @@ Developing stack_car often requires a rails application for you to run updated c
|
|
54
61
|
- Run `bundle exec rake release`
|
55
62
|
- This will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
56
63
|
|
64
|
+
## Dockerizing an application
|
65
|
+
|
66
|
+
Dockerizing your application with stack_car can be thought of in 2 steps:
|
67
|
+
- **Generate the file templates**
|
68
|
+
- **Customize provided templates to the requirements of the application**
|
69
|
+
|
70
|
+
### Generate templates (`sc dockerize`)
|
71
|
+
You can generate requisite files for running your application for local development in Docker with the **dockerize** command.
|
72
|
+
|
73
|
+
To **dockerize** your application:
|
74
|
+
- `cd` into your project dir
|
75
|
+
- Run `sc dockerize` to generate files, appending **service flags** to scaffold any other services your application requires
|
76
|
+
- **For example**:
|
77
|
+
- For rails/postgres: `sc dockerize --postgres`
|
78
|
+
- For rails/mysql/redis: `sc dockerize --mysql --redis`
|
79
|
+
|
80
|
+
This command will provide:
|
81
|
+
- `Dockerfile`
|
82
|
+
- `docker-compose.yml`
|
83
|
+
- `.env*` files
|
84
|
+
- **ops** files to get you set up for running your application with **nginx**.
|
85
|
+
|
86
|
+
### Customize templates
|
87
|
+
|
88
|
+
stack_car will have provided sensible defaults for your services but customization will be required per needs of each project (ie api tokens and email configuration where applicable).
|
89
|
+
|
90
|
+
**Customization workflow**
|
91
|
+
- Do a text search to find and replace any instances `CHANGEME` in the generated files
|
92
|
+
- Add any **general environment variables** to `.env`
|
93
|
+
- This sets defaults for all docker compose environments
|
94
|
+
- Add any **development environment variables** to `.env.development`
|
95
|
+
- These set up any new values or overrides specific to your development env
|
96
|
+
- Run `sc build` to build your image
|
97
|
+
- On failed build, browse the terminal output to track down and squash any misconfigurations. Rebuild
|
98
|
+
- Upon successful build, run `sc up` to spin up project
|
99
|
+
- If you get errors, browse the terminal output to track down and squash any misconfigurations (refer to the Docker dashboard to see separate logs for each service)
|
100
|
+
- Visit site at `localhost:3000`
|
101
|
+
- Alternatively, visit it at the host you have specified to work with **Dory**
|
102
|
+
- **Note**: *Depending on the DB required by your application, you will need to create the DB. You need to do that within from the container:*
|
103
|
+
- Using the `bundle-exec` command: `sc bundle-exec db:create`
|
104
|
+
- Shelling in and running in the container shell:
|
105
|
+
```bash
|
106
|
+
sc exec bash
|
107
|
+
bundle exec rails db:create
|
108
|
+
```
|
109
|
+
|
110
|
+
Once all services are running and speaking to each other you are good to go.
|
111
|
+
|
112
|
+
**Tips**:
|
113
|
+
- Any changes to `Dockerfile` will require `sc build` for the changes to manifest
|
114
|
+
- Changes to `docker-compose.yml` **do not require rebuild unless you have changed the image**
|
115
|
+
|
57
116
|
## Generating a Helm Chart
|
58
117
|
|
59
118
|
stack_car's **dockerize** command can be used in conjunction with available flags to generate a **Helm chart** template for your application. You will need to create the *values* files with necessary configuration values from the *sample-values* provided by stack_car, but the command will effectively give you the baseline Notch8 template (scripts, template files, template helpers, sample values file) for a **Helm base Kubernetes deploy**
|
@@ -88,15 +147,14 @@ Since values files are likely to contain sensitive information like API keys, th
|
|
88
147
|
|
89
148
|
Example workflow (given values file is already created):
|
90
149
|
- Edit values file
|
91
|
-
- `
|
92
|
-
- This command will create `staging-values.yaml.enc`
|
93
|
-
- `git add staging-values.yaml.enc`
|
150
|
+
- `bin/encrypt-secrets`
|
151
|
+
- This command will create/update `staging-values.yaml.enc`
|
94
152
|
- Commit and push
|
95
153
|
|
96
154
|
When pulling down a repo or branch, you will need to start by decrypting.
|
97
155
|
|
98
156
|
Example:
|
99
|
-
- `
|
157
|
+
- `bin/decrypt-secrets`
|
100
158
|
|
101
159
|
## Contributing
|
102
160
|
|
data/lib/stack_car/cli.rb
CHANGED
@@ -39,7 +39,55 @@ module StackCar
|
|
39
39
|
run("#{dotenv} docker-compose stop #{options[:service]}")
|
40
40
|
run_with_exit("rm -rf tmp/pids/*")
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
|
+
method_option :volumes, aliases: '-v'
|
44
|
+
method_option :rmi
|
45
|
+
method_option :'remove-orphans'
|
46
|
+
method_option :service, aliases: '-s'
|
47
|
+
method_option :timeout, aliases: '-t'
|
48
|
+
method_option :all, aliases: '-a'
|
49
|
+
method_option :help, aliases: '-h'
|
50
|
+
desc 'down', 'stops and removes containers and networks specific to this project by default, run with -h for more options'
|
51
|
+
def down
|
52
|
+
setup
|
53
|
+
ensure_development_env
|
54
|
+
|
55
|
+
if options[:help]
|
56
|
+
run('docker-compose down --help')
|
57
|
+
say 'Additional stack_car options:'
|
58
|
+
say ' -a, --all Removes all containers, networks, volumes, and'
|
59
|
+
say ' images created by `up`.'
|
60
|
+
say ' -s, --service Specify a service defined in the Compose file'
|
61
|
+
say ' whose containers and volumes should be removed.'
|
62
|
+
exit(0)
|
63
|
+
end
|
64
|
+
|
65
|
+
if options[:service]
|
66
|
+
rm_vol = true if options[:volumes]
|
67
|
+
|
68
|
+
remove_container(options[:service], rm_vol)
|
69
|
+
exit(0)
|
70
|
+
end
|
71
|
+
|
72
|
+
run_conf = 'Running down will stop and remove all of the Docker containers and networks ' \
|
73
|
+
'defined in the docker-compose.yml file. Continue?'
|
74
|
+
prompt_run_confirmation(run_conf)
|
75
|
+
|
76
|
+
args = []
|
77
|
+
if options[:all]
|
78
|
+
prompt_run_confirmation('--all will remove all containers, volumes, networks, local images, and orphaned containers. Continue?')
|
79
|
+
|
80
|
+
args = %w[--volumes --rmi=local --remove-orphans]
|
81
|
+
else
|
82
|
+
args << '--volumes' if options[:volumes]
|
83
|
+
args << '--rmi=local' if options[:rmi]
|
84
|
+
args << '--remove-orphans' if options[:'remove-orphans']
|
85
|
+
args << '--timeout' if options[:timeout]
|
86
|
+
end
|
87
|
+
|
88
|
+
run("#{dotenv} docker-compose down #{args.join(' ')}")
|
89
|
+
run_with_exit('rm -rf tmp/pids/*')
|
90
|
+
end
|
43
91
|
|
44
92
|
method_option :service, default: 'web', type: :string, aliases: '-s'
|
45
93
|
desc "build", "builds specified service, defaults to web"
|
@@ -167,15 +215,15 @@ module StackCar
|
|
167
215
|
method_option :helm, default: false, type: :boolean, aliases: '-h'
|
168
216
|
method_option :git, default: false, type: :boolean, aliases: '-g'
|
169
217
|
method_option :heroku, default: false, type: :boolean, aliases: '-h'
|
170
|
-
method_option :hyku, default: false, type: :boolean, aliases:
|
218
|
+
method_option :hyku, default: false, type: :boolean, aliases: "\--hu"
|
171
219
|
method_option :imagemagick, default: false, type: :boolean, aliases: '-i'
|
172
|
-
method_option :memcached, default: false, type: :boolean, aliases:
|
173
|
-
method_option :mongodb, default: false, type: :boolean, aliases:
|
220
|
+
method_option :memcached, default: false, type: :boolean, aliases: "\--mc"
|
221
|
+
method_option :mongodb, default: false, type: :boolean, aliases: "\--mg"
|
174
222
|
method_option :mysql, default: false, type: :boolean, aliases: '-m'
|
175
223
|
method_option :postgres, default: false, type: :boolean, aliases: '-p'
|
176
|
-
method_option :rancher, default: false, type: :boolean, aliases:
|
224
|
+
method_option :rancher, default: false, type: :boolean, aliases: "\--dr"
|
177
225
|
method_option :redis, default: false, type: :boolean, aliases: '-r'
|
178
|
-
method_option :sidekiq, default: false, type: :boolean, aliases:
|
226
|
+
method_option :sidekiq, default: false, type: :boolean, aliases: "\--sk"
|
179
227
|
method_option :solr, default: false, type: :boolean, aliases: '-s'
|
180
228
|
method_option :yarn, default: false, type: :boolean, aliases: '-y'
|
181
229
|
desc 'dockerize DIR', 'Will copy the docker tempates in to your project, see options for supported dependencies'
|
@@ -218,9 +266,15 @@ module StackCar
|
|
218
266
|
puts template_file
|
219
267
|
template("#{template_file}.erb", template_file)
|
220
268
|
end
|
221
|
-
|
269
|
+
directory('.gitlab', '.gitlab')
|
222
270
|
template(".env.development.erb", ".env.development")
|
223
271
|
template(".env.erb", ".env.production")
|
272
|
+
template(".sops.yaml.erb", ".sops.yaml")
|
273
|
+
template("decrypt-secrets", "bin/decrypt-secrets")
|
274
|
+
template("encrypt-secrets", "bin/encrypt-secrets")
|
275
|
+
template("database.yml.erb", "config/database.yml")
|
276
|
+
template("development.rb.erb", "config/environments/development.rb")
|
277
|
+
template("production.rb.erb", "config/environments/production.rb")
|
224
278
|
|
225
279
|
if File.exists?('README.md')
|
226
280
|
prepend_to_file "README.md" do
|
@@ -272,7 +326,7 @@ module StackCar
|
|
272
326
|
protected
|
273
327
|
def compose_depends(*excludes)
|
274
328
|
@compose_depends = []
|
275
|
-
services = [:postgres, :mysql, :elasticsearch, :solr, :redis, :mongodb, :memcached] - excludes
|
329
|
+
services = [:fcrepo, :postgres, :mysql, :elasticsearch, :sidekiq, :solr, :redis, :mongodb, :memcached] - excludes
|
276
330
|
services.each do |service|
|
277
331
|
if options[service]
|
278
332
|
@compose_depends << " - #{service}"
|
@@ -350,5 +404,77 @@ module StackCar
|
|
350
404
|
end
|
351
405
|
DotRc.new
|
352
406
|
end
|
407
|
+
|
408
|
+
def remove_container(service_name, remove_volumes)
|
409
|
+
container = find_container_by_service(service_name)
|
410
|
+
|
411
|
+
container.map do |id, name|
|
412
|
+
prompt_run_confirmation("Remove #{name} container?")
|
413
|
+
|
414
|
+
if `docker container ls --format "{{.Names}}"`.include?(name)
|
415
|
+
say 'Stopping container...'
|
416
|
+
`docker stop #{id}`
|
417
|
+
end
|
418
|
+
|
419
|
+
say 'Removing container...'
|
420
|
+
`docker container rm #{id}`
|
421
|
+
|
422
|
+
# Ensure container was removed
|
423
|
+
if `docker ps -aqf id=#{id}`.empty?
|
424
|
+
say " Container #{name} was removed"
|
425
|
+
else
|
426
|
+
say ">>> There was an issue removing container #{name} (#{id})"
|
427
|
+
end
|
428
|
+
end
|
429
|
+
|
430
|
+
remove_volumes_mounted_to_container(@container_volume_names) if remove_volumes
|
431
|
+
end
|
432
|
+
|
433
|
+
def find_container_by_service(service_name)
|
434
|
+
container_id = `docker-compose ps -aq #{service_name}`.strip
|
435
|
+
|
436
|
+
if container_id.empty?
|
437
|
+
say "Unable to locate a container for the service '#{service_name}'"
|
438
|
+
say "Try running `docker-compose ps #{service_name}` to make sure the container exists"
|
439
|
+
exit(1)
|
440
|
+
end
|
441
|
+
|
442
|
+
get_volume_names_for_container(container_id)
|
443
|
+
container_name = `docker ps -af id=#{container_id} --format "{{.Names}}"`.strip
|
444
|
+
|
445
|
+
{ container_id => container_name }
|
446
|
+
end
|
447
|
+
|
448
|
+
def remove_volumes_mounted_to_container(volumes)
|
449
|
+
return if volumes.empty?
|
450
|
+
|
451
|
+
prompt_run_confirmation("\n#{volumes.join("\n")}\nRemove these volume(s)?")
|
452
|
+
volumes.each do |v|
|
453
|
+
say 'Removing volume...'
|
454
|
+
`docker volume rm #{v}`
|
455
|
+
|
456
|
+
if `docker volume ls -q`.include?(v)
|
457
|
+
say ">>> There was an issue removing volume #{v}"
|
458
|
+
else
|
459
|
+
say " Volume #{v} was removed"
|
460
|
+
end
|
461
|
+
end
|
462
|
+
end
|
463
|
+
|
464
|
+
def get_volume_names_for_container(container_id)
|
465
|
+
@container_volume_names ||= []
|
466
|
+
return @container_volume_names unless @container_volume_names.empty?
|
467
|
+
|
468
|
+
JSON.parse(`docker inspect --format="{{json .Mounts}}" #{container_id}`).map do |mount_info|
|
469
|
+
@container_volume_names << mount_info['Name'] if mount_info['Type'] == 'volume'
|
470
|
+
end
|
471
|
+
|
472
|
+
@container_volume_names
|
473
|
+
end
|
474
|
+
|
475
|
+
def prompt_run_confirmation(question)
|
476
|
+
response = ask(question, limited_to: %w[y n])
|
477
|
+
exit(1) unless response == 'y'
|
478
|
+
end
|
353
479
|
end
|
354
480
|
end
|
data/lib/stack_car/version.rb
CHANGED
data/stack_car.gemspec
CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.13"
|
23
|
+
spec.add_development_dependency "byebug"
|
23
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
25
|
spec.add_development_dependency "rspec", "~> 3.0"
|
25
26
|
spec.add_development_dependency "yard"
|
data/templates/.env.erb
CHANGED
@@ -2,6 +2,20 @@ APP_NAME=<%= @project_name %>
|
|
2
2
|
PASSENGER_APP_ENV=development
|
3
3
|
REGISTRY_HOST=registry.gitlab.com
|
4
4
|
REGISTRY_URI=/CHANGEME/<%= @project_name %>
|
5
|
+
|
6
|
+
# SMTP Mailer variables
|
7
|
+
# To enable mailer:
|
8
|
+
# - Uncomment and edit SMTP vars
|
9
|
+
# - Uncomment SMTP Mailer section in respective config/environments file
|
10
|
+
# SMTP_USER_NAME=CHANGEME
|
11
|
+
# SMTP_PASSWORD=CHANGEME
|
12
|
+
# SMTP_ADDRESS=CHANGEME
|
13
|
+
# SMTP_DOMAIN=CHANGEME
|
14
|
+
# SMTP_PORT=CHANGEME
|
15
|
+
# SMTP_TYPE=CHANGEME
|
16
|
+
<% if options[:hyku] %>
|
17
|
+
# SETTINGS__MULTITENANCY__ADMIN_HOST=CHANGEME
|
18
|
+
<% end %>
|
5
19
|
TAG=dev
|
6
20
|
<% if options[:postgres] -%>
|
7
21
|
DATABASE_NAME=<%= @project_name %>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Summary
|
2
|
+
|
3
|
+
A short description of the bug. Use # to link to the parent issue or merge request
|
4
|
+
|
5
|
+
# Observed Behavior
|
6
|
+
|
7
|
+
The current, bugged behavior.
|
8
|
+
|
9
|
+
# Expected Behavior
|
10
|
+
|
11
|
+
How it should behave once it's fixed. What "done" looks like.
|
12
|
+
|
13
|
+
# Screenshots or Video
|
14
|
+
|
15
|
+
Include screenshots or videos that demonstrate the bug
|
16
|
+
|
17
|
+
# Other Information
|
18
|
+
|
19
|
+
Any other logs, related issues, merge requests, wireframes, documentation, slack conversations or anything else that would help the developer try to find and fix this issue, or provide context.
|
20
|
+
|
21
|
+
# Acceptance Criteria
|
22
|
+
|
23
|
+
This is what done looks like. A higher level checklist of the goals and functionality after this bug is fixed
|
24
|
+
|
25
|
+
* [ ] I see these views
|
26
|
+
* [ ] When a user does this, that happens
|
27
|
+
|
28
|
+
# Steps to Reproduce / Testing Instructions
|
29
|
+
|
30
|
+
How did you trigger this bug? Include links to the page where the error occured, if applicable.
|
31
|
+
|
32
|
+
* [ ] As a (logged in/admin/etc) User
|
33
|
+
* [ ] With these other conditions
|
34
|
+
* [ ] I did these things
|
35
|
+
* [ ] And observed this behavior
|
36
|
+
|
37
|
+
## Further information
|
38
|
+
|
39
|
+
Edit in any later issues or merge requests that are conencted to this issue, for future reference
|
40
|
+
|
41
|
+
### Implementation suggestions
|
42
|
+
|
43
|
+
Are nice, but should probably go in a comment. e.g. gems, unrelated issues that dealt with similar problems, stack overflow links.
|
44
|
+
|
45
|
+
/label ~"Needs Rework", ~"Ready for Development"
|
46
|
+
<!-- By default, should bugs go to Ready for development, to be on the development board, or be like normal issues and go to the planning board> -->
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Summary
|
2
|
+
|
3
|
+
A short description of the feature
|
4
|
+
|
5
|
+
# User Stories
|
6
|
+
|
7
|
+
What problem is this feature going to solve?
|
8
|
+
|
9
|
+
# Screenshots or Video
|
10
|
+
|
11
|
+
Include any relevant media such as wireframes, screenshots, or videos
|
12
|
+
|
13
|
+
# Relationships
|
14
|
+
|
15
|
+
Are there any other issues or merge requests that are related to this feature (use # to generate a quick link). In particular, is this part of a larger epic, or does it depend on any other tickets being resolved first? Do you need anything else or are you making any other assumptions for this feature?
|
16
|
+
|
17
|
+
# Acceptance Criteria
|
18
|
+
|
19
|
+
This is what done looks like. A higher level checklist of the goals and functionality of this feature
|
20
|
+
|
21
|
+
* [ ] I see these views
|
22
|
+
* [ ] When a user does this, that happens
|
23
|
+
|
24
|
+
# Testing Instructions
|
25
|
+
|
26
|
+
Steps to demonstrate this feature is properly working. Include a video, if possible. The How to the Acceptance Criteria's What
|
27
|
+
|
28
|
+
* [ ] As a (user/admin)
|
29
|
+
* [ ] Go here and do these things
|
30
|
+
* [ ] To see this happen
|
31
|
+
|
32
|
+
|
33
|
+
## Further information
|
34
|
+
|
35
|
+
Edit in any later issues or merge requests that are conencted to this issue, for future reference
|
36
|
+
|
37
|
+
### Implimentation Suggestions
|
38
|
+
|
39
|
+
Any development details that would be helpful when working on this feature e.g. gems, unrelated issues that dealt with similar problems, stack overflow links.
|
40
|
+
|
41
|
+
/label ~Icebox
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Summary
|
2
|
+
A short description of the question.
|
3
|
+
|
4
|
+
## Who has this information
|
5
|
+
Consider using @ to tag them, if they're in this repository
|
6
|
+
|
7
|
+
# Additional information
|
8
|
+
More details about what needs to be answered
|
9
|
+
* [ ] Checkboxes are helpful
|
10
|
+
* [ ] To make sure all answers are enumerated
|
11
|
+
|
12
|
+
# Other links
|
13
|
+
Pictures, videos, links to issues, or anything else that might be helpful to provide context for the question
|
14
|
+
|
15
|
+
/label ~"Planning in Progress"
|
16
|
+
|
17
|
+
/assign me
|
18
|
+
<!-- this might cause inboxes to explode, but presumably the one creating a question ticket would be the one who was taking ownership for it, and would be the one responsible for cleaning it up once the question was answered -->
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Summary
|
2
|
+
A short description of the bug
|
3
|
+
|
4
|
+
# Related Issue
|
5
|
+
Use # to add a quick link to the parent issue(s), or ! for parent merge requests. Also, go to the issue and edit it to mention this MR.
|
6
|
+
|
7
|
+
# Expected Behavior
|
8
|
+
|
9
|
+
Demo how this merge request is working in the app. Consult the steps for reproducing the bug in the issue.
|
10
|
+
|
11
|
+
# Screenshots / Video
|
12
|
+
Include screenshots or video demonstrating how this bug fix works
|
13
|
+
|
14
|
+
# Dependencies
|
15
|
+
|
16
|
+
Are there any other outstanding issues which need to be resolved before this can be merged?
|
17
|
+
|
18
|
+
# Special Attention / Side Effects
|
19
|
+
|
20
|
+
Is there anything you would like to have special scrutiny given to during code review? Will the changes in this merge request potentially impact any thing else that isn't explicitly part of this bug fix?
|
21
|
+
|
22
|
+
# Testing / Reproduction instructions
|
23
|
+
|
24
|
+
Step by step instructions on how to test this bug fix. Include links and username/passswords if necessary. Videos are especially helpful. Also, name any spec files that should be run for this bug fix, or to test any side effects from this bug fix.
|
25
|
+
|
26
|
+
1. Go here
|
27
|
+
2. Do this
|
28
|
+
3. Observe this behavior
|
29
|
+
|
30
|
+
# Deployment
|
31
|
+
|
32
|
+
Where is this deployed? Are there any additional steps to get this working on staging/production? (e.g. setting up enviromental variables)
|
33
|
+
|
34
|
+
# Other Information
|
35
|
+
|
36
|
+
Any other logs, related issues, merge requests, wireframes, documentation, slack conversations or anything else that would help the developer try to find and fix this issue, or provide context.
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Summary
|
2
|
+
A short description of the feature
|
3
|
+
|
4
|
+
# Related Issue
|
5
|
+
Use # to add a quick link to the parent issue(s), or ! for parent merge requests. Also, go to that issue and edit the description to mention this MR.
|
6
|
+
|
7
|
+
# Expected Behavior
|
8
|
+
|
9
|
+
Demo how this merge request is working in the app. Consult the acceptance criteria in the issue.
|
10
|
+
|
11
|
+
# Screenshots / Video
|
12
|
+
Include screenshots or video demonstrating how this feature works
|
13
|
+
|
14
|
+
# Dependencies
|
15
|
+
|
16
|
+
Are there any other outstanding issues which need to be resolved before this can be merged?
|
17
|
+
|
18
|
+
# Special Attention / Side Effects
|
19
|
+
|
20
|
+
Is there anything you would like to have special scrutiny given to during code review? Will the changes in this merge request potentially impact any thing else that isn't explicitly part of this feature?
|
21
|
+
|
22
|
+
# Testing / Reproduction instructions
|
23
|
+
|
24
|
+
Step by step instructions on how to test this feature. Include links and username/passswords if necessary. Videos are especially helpful. Also, name any spec files that should be run for this feature, or to test any side effects from this feature.
|
25
|
+
|
26
|
+
1. Go here
|
27
|
+
2. Do this
|
28
|
+
3. Observe this behavior
|
29
|
+
|
30
|
+
# Deployment
|
31
|
+
|
32
|
+
Where is this deployed? Are there any additional steps to get this working on staging/production? (e.g. setting up enviromental variables)
|
33
|
+
|
34
|
+
# Other Information
|
35
|
+
|
36
|
+
Any other logs, related issues, merge requests, wireframes, documentation, slack conversations or anything else that would help the developer try to find and fix this issue, or provide context.
|
@@ -109,7 +109,7 @@ review:
|
|
109
109
|
only:
|
110
110
|
- branches
|
111
111
|
except:
|
112
|
-
-
|
112
|
+
- main
|
113
113
|
script:
|
114
114
|
<% if options[:rancher] -%>
|
115
115
|
- export RANCHER_ENVIRONMENT=staging
|
@@ -149,7 +149,7 @@ staging:
|
|
149
149
|
- dpl --provider=heroku --app=<%= @project_name %>-staging --api-key=$HEROKU_STAGING_API_KEY --run="bundle exec rake db:migrate"
|
150
150
|
<% end -%>
|
151
151
|
only:
|
152
|
-
-
|
152
|
+
- main
|
153
153
|
tags:
|
154
154
|
- local
|
155
155
|
|
@@ -167,6 +167,6 @@ production:
|
|
167
167
|
<% end -%>
|
168
168
|
when: manual
|
169
169
|
only:
|
170
|
-
-
|
170
|
+
- main
|
171
171
|
tags:
|
172
172
|
- local
|
data/templates/README.md
CHANGED
@@ -1,19 +1,93 @@
|
|
1
|
+
[Docker development setup](#docker-development-setup)
|
2
|
+
|
3
|
+
[Bash into the container](#bash-into-the-container)
|
4
|
+
|
5
|
+
[Handling Secrets with SOPS](#handling-secrets-with-sops)
|
6
|
+
|
7
|
+
[Deploy a new release](#deploy-a-new-release)
|
8
|
+
|
9
|
+
[Run import from admin page](#run-import-from-admin-page)
|
10
|
+
|
1
11
|
# Docker development setup
|
2
12
|
|
3
|
-
|
13
|
+
We recommend committing .env to your repo with good defaults. .env.development, .env.production etc can be used for local overrides and should not be in the repo. See [Handling Secrets with SOPS](#handling-secrets-with-sops) for how to manage secrets.
|
14
|
+
|
15
|
+
1) Install Docker.app
|
4
16
|
|
5
|
-
2)
|
17
|
+
2) Install stack car
|
18
|
+
``` bash
|
19
|
+
gem install stack_car
|
20
|
+
```
|
6
21
|
|
7
|
-
3)
|
22
|
+
3) Sign in with dory
|
23
|
+
``` bash
|
24
|
+
dory up
|
25
|
+
```
|
8
26
|
|
9
|
-
4)
|
27
|
+
4) Install dependencies
|
28
|
+
``` bash
|
29
|
+
yarn install
|
30
|
+
```
|
10
31
|
|
32
|
+
5) Start the server
|
33
|
+
``` bash
|
34
|
+
sc up
|
35
|
+
```
|
36
|
+
|
37
|
+
6) Load and seed the database
|
38
|
+
``` bash
|
39
|
+
sc be rake db:migrate db: seed
|
40
|
+
```
|
41
|
+
### Troubleshooting Docker Development Setup
|
42
|
+
Confirm or configure settings. Sub your information for the examples.
|
11
43
|
``` bash
|
12
|
-
|
13
|
-
|
44
|
+
git config --global user.name example
|
45
|
+
git config --global user.email example@example.com
|
46
|
+
docker login registry.gitlab.com
|
47
|
+
```
|
48
|
+
|
49
|
+
### While in the container you can do the following
|
50
|
+
- Run rspec
|
51
|
+
``` bash
|
52
|
+
bundle exec rspec
|
53
|
+
```
|
54
|
+
- Access the rails console
|
55
|
+
``` bash
|
56
|
+
bundle exec rails c
|
57
|
+
```
|
58
|
+
|
59
|
+
### Handling Secrets with SOPS
|
60
|
+
|
61
|
+
[**SOPS**](https://github.com/mozilla/sops) is used to handle this project's secrets.
|
14
62
|
|
63
|
+
The secrets in this repository include:
|
64
|
+
- `.env*` files
|
65
|
+
- `*-values.yaml` files
|
66
|
+
|
67
|
+
Scripts (`bin/decrypt-secrets` and `bin/encrypt-secrets`) are included in this project to help with managing secrets.
|
68
|
+
|
69
|
+
**To decrypt secrets**:
|
70
|
+
|
71
|
+
You will need to do this if you are new to the project or there have been changes to any secrets files that are required for development.
|
72
|
+
|
73
|
+
In terminal:
|
74
|
+
```bash
|
75
|
+
bin/decrypt-secrets
|
76
|
+
```
|
77
|
+
|
78
|
+
This will find and decrypt files with the `.enc` extension.
|
79
|
+
|
80
|
+
**To encrypt secrets**:
|
81
|
+
|
82
|
+
You will need to do this when you have edited secrets and are ready to commit them.
|
83
|
+
|
84
|
+
In terminal:
|
85
|
+
```bash
|
86
|
+
bin/encrypt-secrets
|
15
87
|
```
|
16
88
|
|
89
|
+
This will find and output an encrypted version of secret files with an `.enc` extension.
|
90
|
+
|
17
91
|
# Deploy a new release
|
18
92
|
|
19
93
|
``` bash
|
@@ -21,4 +95,4 @@ sc release {staging | production} # creates and pushes the correct tags
|
|
21
95
|
sc deploy {staging | production} # deployes those tags to the server
|
22
96
|
```
|
23
97
|
|
24
|
-
|
98
|
+
Release and Deployment are handled by the gitlab ci by default. See ops/deploy-app to deploy from locally, but note all Rancher install pull the currently tagged registry image
|
@@ -5,25 +5,26 @@ name: <%= @project_name %>
|
|
5
5
|
version: 0.0.1
|
6
6
|
dependencies:
|
7
7
|
<%- if options[:solr] %>
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
- name: solr
|
9
|
+
version: 1.5.2
|
10
|
+
repository: https://charts.helm.sh/incubator
|
11
|
+
condition: solr.enabled
|
11
12
|
<%- end %>
|
12
13
|
<%- if options[:redis] %>
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
- name: redis
|
15
|
+
version: 11.0.4
|
16
|
+
repository: https://charts.bitnami.com/bitnami
|
17
|
+
condition: redis.enabled
|
17
18
|
<%- end %>
|
18
19
|
<%- if options[:postgres] %>
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
- name: postgresql
|
21
|
+
version: 10.3.18
|
22
|
+
repository: https://charts.bitnami.com/bitnami
|
23
|
+
condition: postgresql.enabled
|
23
24
|
<%- end %>
|
24
25
|
<%- if options[:mysql] %>
|
25
26
|
- name: mariadb
|
26
|
-
version:
|
27
|
-
repository: https://
|
27
|
+
version: 7.3.14
|
28
|
+
repository: https://charts.helm.sh/stable
|
28
29
|
condition: mariadb.enabled
|
29
|
-
<%- end %>
|
30
|
+
<%- end %>
|
data/templates/chart/bin/deploy
CHANGED
data/templates/chart/bin/remove
CHANGED
@@ -17,6 +17,7 @@ zookeeper:
|
|
17
17
|
size: 1Gi
|
18
18
|
<% end %>
|
19
19
|
|
20
|
+
<% if options[:postgres] %>
|
20
21
|
postgresql:
|
21
22
|
enabled: true
|
22
23
|
<% if options[:fedora] %>
|
@@ -33,6 +34,8 @@ postgresql:
|
|
33
34
|
persistence:
|
34
35
|
enabled: true
|
35
36
|
size: 1Gi
|
37
|
+
<% end %>
|
38
|
+
|
36
39
|
<% if options[:mysql] %>
|
37
40
|
externalDatabase:
|
38
41
|
host: host_name
|
@@ -117,7 +120,6 @@ env:
|
|
117
120
|
<% if options[:fcrepo] %>
|
118
121
|
FC_DATABASE_NAME: fcrepo
|
119
122
|
LD_LIBRARY_PATH: /opt/fits-latest/tools/mediainfo/linux
|
120
|
-
SETTINGS__ACTIVE_JOB__QUEUE_ADAPTER: sidekiq
|
121
123
|
SETTINGS__CONTACT_EMAIL: admin@example.org
|
122
124
|
SETTINGS__DEVISE__INVITATION_FROM_EMAIL: admin@example.org
|
123
125
|
SETTINGS__FITS_PATH: /opt/fits/fits.sh
|
@@ -126,13 +128,26 @@ env:
|
|
126
128
|
SETTINGS__MULTITENANCY__DEFAULT_HOST: "%{tenant}.app.docker"
|
127
129
|
SETTINGS__MULTITENANCY__ENABLED: "true"
|
128
130
|
<% end %>
|
131
|
+
<% if options[:sidekiq] %>
|
132
|
+
SETTINGS__ACTIVE_JOB__QUEUE_ADAPTER: sidekiq
|
133
|
+
<% end %>
|
129
134
|
DATABASE_NAME: <%= @project_name %>
|
130
135
|
IN_DOCKER: "true"
|
131
136
|
PASSENGER_APP_ENV: production
|
132
137
|
RAILS_ENV: production
|
133
138
|
RAILS_LOG_TO_STDOUT: "true"
|
134
139
|
RAILS_SERVE_STATIC_FILES: "true"
|
140
|
+
# SMTP Mailer vars
|
141
|
+
# Uncomment vars and SMTP Mailer in config/environments/<environment>.rb to enable
|
142
|
+
# SMTP_USER_NAME: CHANGEME
|
143
|
+
# SMTP_ADDRESS: CHANGEME
|
144
|
+
# SMTP_DOMAIN: CHANGEME
|
145
|
+
# SMTP_PORT: CHANGEME
|
146
|
+
# SMTP_TYPE: CHANGEME
|
135
147
|
|
136
148
|
secret:
|
137
149
|
SECRET_KEY_BASE: secretabc
|
138
150
|
DATABASE_PASSWORD: passwordabc
|
151
|
+
# SMTP Mailer secret
|
152
|
+
# Uncomment vars and SMTP Mailer in config/environments/<environment>.rb to enable
|
153
|
+
# SMTP_PASSWORD: CHANGEME
|
data/templates/database.yml.erb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# require 'byebug'
|
4
|
+
|
5
|
+
parent_dir = File.dirname(__dir__)
|
6
|
+
Dir.chdir(File.join(parent_dir))
|
7
|
+
[
|
8
|
+
".env.*",
|
9
|
+
"chart/*-values.yaml",
|
10
|
+
"ops/kube_config.yml",
|
11
|
+
"ops/.backend",
|
12
|
+
"ops/k8s/*-values.yaml"
|
13
|
+
].each do |files|
|
14
|
+
Dir.glob(files).each do |file|
|
15
|
+
if file.match(/enc/)
|
16
|
+
next unless File.exists?(file)
|
17
|
+
cmd = "sops --decrypt #{file} > #{file.gsub(/.enc$/, '')}"
|
18
|
+
puts cmd
|
19
|
+
`#{cmd}`
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
<% if options[:sidekiq] %>
|
5
|
+
# In the development environment your application's code is reloaded on
|
6
|
+
# every request. This slows down response time but is perfect for development
|
7
|
+
# since you don't have to restart the web server when you make code changes.
|
8
|
+
config.cache_classes = !!Sidekiq.server?
|
9
|
+
<% end -%>
|
10
|
+
|
11
|
+
# Do not eager load code on boot.
|
12
|
+
config.eager_load = false
|
13
|
+
|
14
|
+
# Show full error reports.
|
15
|
+
config.consider_all_requests_local = true
|
16
|
+
|
17
|
+
# Enable/disable caching. By default caching is disabled.
|
18
|
+
if Rails.root.join('tmp/caching-dev.txt').exist?
|
19
|
+
config.action_controller.perform_caching = true
|
20
|
+
|
21
|
+
config.cache_store = :memory_store
|
22
|
+
config.public_file_server.headers = {
|
23
|
+
'Cache-Control' => 'public, max-age=172800'
|
24
|
+
}
|
25
|
+
else
|
26
|
+
config.action_controller.perform_caching = false
|
27
|
+
|
28
|
+
config.cache_store = :null_store
|
29
|
+
end
|
30
|
+
|
31
|
+
# SMTP Mailer configuration
|
32
|
+
# Add SMTP settings to your environment and uncomment the following section to enable mailer
|
33
|
+
# if ENV['SMTP_ENABLED'].present? && ENV['SMTP_ENABLED'].to_s == 'true'
|
34
|
+
# config.action_mailer.smtp_settings = {
|
35
|
+
# user_name: ENV['SMTP_USER_NAME'],
|
36
|
+
# password: ENV['SMTP_PASSWORD'],
|
37
|
+
# address: ENV['SMTP_ADDRESS'],
|
38
|
+
# domain: ENV['SMTP_DOMAIN'],
|
39
|
+
# port: ENV['SMTP_PORT'],
|
40
|
+
# enable_starttls_auto: true,
|
41
|
+
# authentication: ENV['SMTP_TYPE']
|
42
|
+
# }
|
43
|
+
# # ActionMailer Config
|
44
|
+
# config.action_mailer.delivery_method = :smtp
|
45
|
+
# config.action_mailer.perform_deliveries = true
|
46
|
+
# config.action_mailer.raise_delivery_errors = false
|
47
|
+
<% if options[:hyku] %>
|
48
|
+
# config.action_mailer.asset_host = ENV['SETTINGS__MULTITENANCY__ADMIN_HOST']
|
49
|
+
<% end %>
|
50
|
+
# else
|
51
|
+
# config.action_mailer.delivery_method = :test
|
52
|
+
# end
|
53
|
+
|
54
|
+
# Don't care if the mailer can't send.
|
55
|
+
config.action_mailer.raise_delivery_errors = false
|
56
|
+
|
57
|
+
config.action_mailer.perform_caching = false
|
58
|
+
|
59
|
+
# Print deprecation notices to the Rails logger.
|
60
|
+
config.active_support.deprecation = :log
|
61
|
+
|
62
|
+
# Raise an error on page load if there are pending migrations.
|
63
|
+
config.active_record.migration_error = :page_load
|
64
|
+
|
65
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
66
|
+
# This option may cause significant delays in view rendering with a large
|
67
|
+
# number of complex assets.
|
68
|
+
config.assets.debug = true
|
69
|
+
|
70
|
+
# Suppress logger output for asset requests.
|
71
|
+
config.assets.quiet = true
|
72
|
+
|
73
|
+
# Raises error for missing translations
|
74
|
+
# config.action_view.raise_on_missing_translations = true
|
75
|
+
|
76
|
+
config.action_mailer.default_url_options = { host: "localhost:3001" }
|
77
|
+
|
78
|
+
config.web_console.whitelisted_ips = ['172.18.0.0/16', '172.27.0.0/16', '0.0.0.0/0']
|
79
|
+
|
80
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
81
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
82
|
+
logger.formatter = config.log_formatter
|
83
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
84
|
+
end
|
85
|
+
|
86
|
+
config.active_job.queue_adapter = Settings.active_job.queue_adapter
|
87
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
88
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
89
|
+
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
90
|
+
end
|
@@ -110,7 +110,7 @@ services:
|
|
110
110
|
DEPLOY_KEY: "${DEPLOY_KEY}"
|
111
111
|
REPO_URL: "${REPO_URL}"
|
112
112
|
BRANCH: "${BRANCH}"
|
113
|
-
image: "${REGISTRY_HOST}${REGISTRY_URI}:${TAG:-
|
113
|
+
image: "${REGISTRY_HOST}${REGISTRY_URI}:${TAG:-main}"
|
114
114
|
env_file:
|
115
115
|
- .env
|
116
116
|
- .env.development
|
@@ -138,6 +138,7 @@ services:
|
|
138
138
|
worker:
|
139
139
|
extends: app
|
140
140
|
command: ./bin/delayed_job run
|
141
|
+
depends_on:
|
141
142
|
<%= compose_depends %>
|
142
143
|
<% end %>
|
143
144
|
|
@@ -145,6 +146,7 @@ services:
|
|
145
146
|
worker:
|
146
147
|
extends: app
|
147
148
|
command: bundle exec sidekiq
|
149
|
+
depends_on:
|
148
150
|
<%= compose_depends %>
|
149
151
|
<% end %>
|
150
152
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# require 'byebug'
|
4
|
+
|
5
|
+
parent_dir = File.dirname(__dir__)
|
6
|
+
[
|
7
|
+
".env.*",
|
8
|
+
"chart/*-values.yaml",
|
9
|
+
"ops/kube_config.yml",
|
10
|
+
"ops/.backend",
|
11
|
+
"ops/k8s/*-values.yaml"
|
12
|
+
].each do |files|
|
13
|
+
Dir.glob(files).each do |file|
|
14
|
+
next if /enc/.match?(file)
|
15
|
+
cmd = "sops --encrypt #{file} > #{file}.enc"
|
16
|
+
puts cmd
|
17
|
+
`#{cmd}`
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# Code is not reloaded between requests.
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Disable serving static files from the `/public` folder by default since
|
18
|
+
# Apache or NGINX already handles this.
|
19
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
20
|
+
config.public_file_server.headers = {
|
21
|
+
'Cache-Control' => 'public, s-maxage=31536000, maxage=15552000',
|
22
|
+
'Expires' => "#{1.year.from_now.to_formatted_s(:rfc822)}"
|
23
|
+
}
|
24
|
+
# Compress JavaScripts and CSS.
|
25
|
+
config.assets.js_compressor = Uglifier.new(harmony: true)
|
26
|
+
# config.assets.css_compressor = :sass
|
27
|
+
|
28
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
29
|
+
config.assets.compile = false
|
30
|
+
|
31
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
32
|
+
|
33
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
34
|
+
config.action_controller.asset_host = Settings.action_controller.asset_host if Settings.action_controller.asset_host
|
35
|
+
|
36
|
+
# Specifies the header that your server uses for sending files.
|
37
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
38
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
39
|
+
|
40
|
+
# Mount Action Cable outside main process or domain
|
41
|
+
# config.action_cable.mount_path = nil
|
42
|
+
# config.action_cable.url = 'wss://example.com/cable'
|
43
|
+
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
44
|
+
|
45
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
46
|
+
# config.force_ssl = true
|
47
|
+
|
48
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
49
|
+
# when problems arise.
|
50
|
+
config.log_level = :debug
|
51
|
+
|
52
|
+
# Prepend all log lines with the following tags.
|
53
|
+
config.log_tags = [ :request_id ]
|
54
|
+
|
55
|
+
# Use a different cache store in production.
|
56
|
+
# config.cache_store = :mem_cache_store
|
57
|
+
|
58
|
+
# Use a real queuing backend for Active Job (and separate queues per environment)
|
59
|
+
require 'active_job/queue_adapters/better_active_elastic_job_adapter'
|
60
|
+
config.active_job.queue_adapter = Settings.active_job.queue_adapter
|
61
|
+
# config.active_job.queue_name_prefix = "hyku_#{Rails.env}"
|
62
|
+
|
63
|
+
# SMTP Mailer configuration
|
64
|
+
# Add SMTP settings to your environment and uncomment the following section to enable mailer
|
65
|
+
# if ENV['SMTP_ENABLED'].present? && ENV['SMTP_ENABLED'].to_s == 'true'
|
66
|
+
# config.action_mailer.smtp_settings = {
|
67
|
+
# user_name: ENV['SMTP_USER_NAME'],
|
68
|
+
# password: ENV['SMTP_PASSWORD'],
|
69
|
+
# address: ENV['SMTP_ADDRESS'],
|
70
|
+
# domain: ENV['SMTP_DOMAIN'],
|
71
|
+
# port: ENV['SMTP_PORT'],
|
72
|
+
# enable_starttls_auto: true,
|
73
|
+
# authentication: ENV['SMTP_TYPE']
|
74
|
+
# }
|
75
|
+
# # ActionMailer Config
|
76
|
+
# config.action_mailer.delivery_method = :smtp
|
77
|
+
# config.action_mailer.perform_deliveries = true
|
78
|
+
# config.action_mailer.raise_delivery_errors = false
|
79
|
+
<% if options[:hyku] %>
|
80
|
+
# config.action_mailer.asset_host = ENV['SETTINGS__MULTITENANCY__ADMIN_HOST']
|
81
|
+
<% end %>
|
82
|
+
# else
|
83
|
+
# config.action_mailer.delivery_method = :test
|
84
|
+
# end
|
85
|
+
|
86
|
+
config.action_mailer.perform_caching = false
|
87
|
+
|
88
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
89
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
90
|
+
# config.action_mailer.raise_delivery_errors = false
|
91
|
+
#
|
92
|
+
config.action_mailer.default_url_options = { protocol: Settings.ssl_configured ? 'https' : 'http' }
|
93
|
+
|
94
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
95
|
+
# the I18n.default_locale when a translation cannot be found).
|
96
|
+
config.i18n.fallbacks = true
|
97
|
+
|
98
|
+
# Send deprecation notices to registered listeners.
|
99
|
+
config.active_support.deprecation = :notify
|
100
|
+
|
101
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
102
|
+
config.log_formatter = ::Logger::Formatter.new
|
103
|
+
|
104
|
+
# Use a different logger for distributed setups.
|
105
|
+
# require 'syslog/logger'
|
106
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
107
|
+
|
108
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
109
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
110
|
+
logger.formatter = config.log_formatter
|
111
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Do not dump schema after migrations.
|
115
|
+
config.active_record.dump_schema_after_migration = false
|
116
|
+
end
|
117
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stack_car
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Kaufman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.13'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: byebug
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,7 +183,12 @@ files:
|
|
169
183
|
- templates/.env.development.erb
|
170
184
|
- templates/.env.erb
|
171
185
|
- templates/.gitlab-ci.yml.erb
|
172
|
-
- templates/
|
186
|
+
- templates/.gitlab/issue_templates/Bug.md
|
187
|
+
- templates/.gitlab/issue_templates/Feature.md
|
188
|
+
- templates/.gitlab/issue_templates/Question.md
|
189
|
+
- templates/.gitlab/merge_request_templates/Bug.md
|
190
|
+
- templates/.gitlab/merge_request_templates/Feature.md
|
191
|
+
- templates/.sops.yaml.erb
|
173
192
|
- templates/Dockerfile.erb
|
174
193
|
- templates/README.md
|
175
194
|
- templates/chart-fcrepo/fcrepo-deploy.yaml
|
@@ -198,8 +217,11 @@ files:
|
|
198
217
|
- templates/chart/templates/web-ing.yaml
|
199
218
|
- templates/chart/templates/web-svc.yaml
|
200
219
|
- templates/database.yml.erb
|
220
|
+
- templates/decrypt-secrets
|
201
221
|
- templates/deploy.yml.erb
|
222
|
+
- templates/development.rb.erb
|
202
223
|
- templates/docker-compose.yml.erb
|
224
|
+
- templates/encrypt-secrets
|
203
225
|
- templates/env.conf.erb
|
204
226
|
- templates/hosts.erb
|
205
227
|
- templates/nginx.sh.erb
|
@@ -219,6 +241,7 @@ files:
|
|
219
241
|
- templates/ops/roles/docker.ubuntu/templates/docker.conf
|
220
242
|
- templates/ops/roles/docker.ubuntu/tests/vagrant.yml
|
221
243
|
- templates/ops/roles/docker.ubuntu/vars/main.yml
|
244
|
+
- templates/production.rb.erb
|
222
245
|
- templates/provision.yml.erb
|
223
246
|
- templates/webapp.conf.erb
|
224
247
|
- templates/worker.sh.erb
|
@@ -240,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
240
263
|
- !ruby/object:Gem::Version
|
241
264
|
version: '0'
|
242
265
|
requirements: []
|
243
|
-
rubygems_version: 3.0.
|
266
|
+
rubygems_version: 3.0.6
|
244
267
|
signing_key:
|
245
268
|
specification_version: 4
|
246
269
|
summary: A tool to make rails + docker easy
|
@@ -1,13 +0,0 @@
|
|
1
|
-
FROM docker:latest
|
2
|
-
|
3
|
-
RUN apk update && \
|
4
|
-
apk add bash git ruby-json ansible openssh && \
|
5
|
-
gem install stack_car --no-ri --no-rdoc && \
|
6
|
-
<% if options[:rancher] %>
|
7
|
-
wget https://github.com/rancher/cli/releases/download/v0.4.1/rancher-linux-amd64-v0.4.1.tar.gz && \
|
8
|
-
tar zxfv rancher-linux-amd64-v0.4.1.tar.gz && \
|
9
|
-
mv rancher-v0.4.1/rancher /bin/rancher
|
10
|
-
<% end %>
|
11
|
-
<% if options[:heroku] %>
|
12
|
-
gem install dpl multi_json --no-ri --no-rdoc
|
13
|
-
<% end %>
|