tpt-rails 1.2.2 → 1.4.2

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -4
  3. data/lib/generators/{tpt_rails → tpt/rails}/configuration/configuration_generator.rb +0 -0
  4. data/lib/generators/tpt/rails/configuration/templates/config/initializers/tpt_rails.rb +14 -0
  5. data/lib/generators/tpt/rails/continuous_integration/continuous_integration_generator.rb +7 -0
  6. data/lib/generators/tpt/rails/continuous_integration/templates/ci/Dockerfile.tt +42 -0
  7. data/lib/generators/{tpt_rails → tpt/rails}/continuous_integration/templates/ci/docker-compose.yaml.tt +1 -3
  8. data/lib/generators/tpt/rails/continuous_integration/templates/ci/tasks/project.test.unit.tt +22 -0
  9. data/lib/generators/{tpt_rails → tpt/rails}/kubernetes/kubernetes_generator.rb +17 -52
  10. data/lib/generators/tpt/rails/kubernetes/templates/Dockerfile.tt +56 -0
  11. data/lib/generators/tpt/rails/kubernetes/templates/entrypoint.sh +9 -0
  12. data/lib/generators/{tpt_rails → tpt/rails}/kubernetes/templates/kubernetes/helm/Chart.yaml.tt +1 -1
  13. data/lib/generators/{tpt_rails → tpt/rails}/kubernetes/templates/kubernetes/helm/README.md +6 -2
  14. data/lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/requirements.yaml.tt +9 -0
  15. data/lib/generators/{tpt_rails → tpt/rails}/kubernetes/templates/kubernetes/helm/templates/NOTES.txt.tt +0 -0
  16. data/lib/generators/{tpt_rails → tpt/rails}/kubernetes/templates/kubernetes/helm/templates/_env.yaml +0 -0
  17. data/lib/generators/{tpt_rails → tpt/rails}/kubernetes/templates/kubernetes/helm/templates/_helpers.tpl.tt +4 -0
  18. data/lib/generators/{tpt_rails → tpt/rails}/kubernetes/templates/kubernetes/helm/templates/autoscaler.yaml.tt +0 -0
  19. data/lib/generators/{tpt_rails → tpt/rails}/kubernetes/templates/kubernetes/helm/templates/deployment.yaml.tt +2 -1
  20. data/lib/generators/{tpt_rails/kubernetes/templates/kubernetes/helm/templates/hooks/db-migrate.yaml.tt → tpt/rails/kubernetes/templates/kubernetes/helm/templates/hooks/db-prepare.yaml.tt} +6 -3
  21. data/lib/generators/{tpt_rails → tpt/rails}/kubernetes/templates/kubernetes/helm/templates/service.yaml.tt +2 -0
  22. data/lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/values.prod.yaml.tt +82 -0
  23. data/lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/values.staging.yaml.tt +125 -0
  24. data/lib/generators/{tpt_rails → tpt/rails}/kubernetes/templates/kubernetes/helm/values.yaml.tt +85 -14
  25. data/lib/generators/{tpt_rails → tpt/rails}/postman/postman.yaml.tt +0 -0
  26. data/lib/tpt/rails.rb +5 -0
  27. data/lib/tpt/rails/internal/datadog.rb +10 -5
  28. data/lib/tpt/rails/internal/error_reporter.rb +3 -0
  29. data/lib/tpt/rails/version.rb +2 -1
  30. metadata +37 -42
  31. data/lib/generators/tpt_rails/configuration/templates/config/initializers/tpt_rails.rb +0 -10
  32. data/lib/generators/tpt_rails/continuous_integration/continuous_integration_generator.rb +0 -17
  33. data/lib/generators/tpt_rails/continuous_integration/templates/ci/Dockerfile.tt +0 -31
  34. data/lib/generators/tpt_rails/continuous_integration/templates/ci/tasks/project.test.unit +0 -12
  35. data/lib/generators/tpt_rails/continuous_integration/templates/ci/test.Jenkinsfile.tt +0 -40
  36. data/lib/generators/tpt_rails/continuous_integration/templates/ci/test.config.xml.tt +0 -76
  37. data/lib/generators/tpt_rails/continuous_integration/templates/ci/tptcd.Jenkinsfile.tt +0 -7
  38. data/lib/generators/tpt_rails/continuous_integration/templates/ci/tptci.Jenkinsfile.tt +0 -7
  39. data/lib/generators/tpt_rails/kubernetes/templates/Dockerfile.tt +0 -41
  40. data/lib/generators/tpt_rails/kubernetes/templates/entrypoint.sh +0 -13
  41. data/lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/requirements.yaml.tt +0 -8
  42. data/lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/values.prod.yaml.tt +0 -52
  43. data/lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/values.staging.yaml.tt +0 -52
  44. data/lib/tasks/tpt/rails_tasks.rake +0 -23
@@ -1,5 +1,6 @@
1
1
  module Tpt
2
2
  module Rails
3
- VERSION = '1.2.2'
3
+ # Do not change this manually. Our tooling will do it automatically.
4
+ VERSION = '1.4.2'
4
5
  end
5
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tpt-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TpT
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-07 00:00:00.000000000 Z
11
+ date: 2021-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 6.0.2
19
+ version: 6.1.3
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 6.0.2.1
22
+ version: 6.1.3.2
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 6.0.2
29
+ version: 6.1.3
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 6.0.2.1
32
+ version: 6.1.3.2
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: dogstatsd-ruby
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.30'
53
+ version: '0.40'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.30'
60
+ version: '0.40'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: sqlite3
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -72,8 +72,8 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '1.4'
75
- description:
76
- email:
75
+ description:
76
+ email:
77
77
  executables: []
78
78
  extensions: []
79
79
  extra_rdoc_files: []
@@ -91,34 +91,29 @@ files:
91
91
  - app/models/tpt/rails/application_record.rb
92
92
  - app/views/layouts/tpt/rails/application.html.erb
93
93
  - config/routes.rb
94
- - lib/generators/tpt_rails/configuration/configuration_generator.rb
95
- - lib/generators/tpt_rails/configuration/templates/config/initializers/tpt_rails.rb
96
- - lib/generators/tpt_rails/continuous_integration/continuous_integration_generator.rb
97
- - lib/generators/tpt_rails/continuous_integration/templates/ci/Dockerfile.tt
98
- - lib/generators/tpt_rails/continuous_integration/templates/ci/docker-compose.yaml.tt
99
- - lib/generators/tpt_rails/continuous_integration/templates/ci/tasks/project.test.unit
100
- - lib/generators/tpt_rails/continuous_integration/templates/ci/test.Jenkinsfile.tt
101
- - lib/generators/tpt_rails/continuous_integration/templates/ci/test.config.xml.tt
102
- - lib/generators/tpt_rails/continuous_integration/templates/ci/tptcd.Jenkinsfile.tt
103
- - lib/generators/tpt_rails/continuous_integration/templates/ci/tptci.Jenkinsfile.tt
104
- - lib/generators/tpt_rails/kubernetes/kubernetes_generator.rb
105
- - lib/generators/tpt_rails/kubernetes/templates/Dockerfile.tt
106
- - lib/generators/tpt_rails/kubernetes/templates/entrypoint.sh
107
- - lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/Chart.yaml.tt
108
- - lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/README.md
109
- - lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/requirements.yaml.tt
110
- - lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/templates/NOTES.txt.tt
111
- - lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/templates/_env.yaml
112
- - lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/templates/_helpers.tpl.tt
113
- - lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/templates/autoscaler.yaml.tt
114
- - lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/templates/deployment.yaml.tt
115
- - lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/templates/hooks/db-migrate.yaml.tt
116
- - lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/templates/service.yaml.tt
117
- - lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/values.prod.yaml.tt
118
- - lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/values.staging.yaml.tt
119
- - lib/generators/tpt_rails/kubernetes/templates/kubernetes/helm/values.yaml.tt
120
- - lib/generators/tpt_rails/postman/postman.yaml.tt
121
- - lib/tasks/tpt/rails_tasks.rake
94
+ - lib/generators/tpt/rails/configuration/configuration_generator.rb
95
+ - lib/generators/tpt/rails/configuration/templates/config/initializers/tpt_rails.rb
96
+ - lib/generators/tpt/rails/continuous_integration/continuous_integration_generator.rb
97
+ - lib/generators/tpt/rails/continuous_integration/templates/ci/Dockerfile.tt
98
+ - lib/generators/tpt/rails/continuous_integration/templates/ci/docker-compose.yaml.tt
99
+ - lib/generators/tpt/rails/continuous_integration/templates/ci/tasks/project.test.unit.tt
100
+ - lib/generators/tpt/rails/kubernetes/kubernetes_generator.rb
101
+ - lib/generators/tpt/rails/kubernetes/templates/Dockerfile.tt
102
+ - lib/generators/tpt/rails/kubernetes/templates/entrypoint.sh
103
+ - lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/Chart.yaml.tt
104
+ - lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/README.md
105
+ - lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/requirements.yaml.tt
106
+ - lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/templates/NOTES.txt.tt
107
+ - lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/templates/_env.yaml
108
+ - lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/templates/_helpers.tpl.tt
109
+ - lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/templates/autoscaler.yaml.tt
110
+ - lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/templates/deployment.yaml.tt
111
+ - lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/templates/hooks/db-prepare.yaml.tt
112
+ - lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/templates/service.yaml.tt
113
+ - lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/values.prod.yaml.tt
114
+ - lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/values.staging.yaml.tt
115
+ - lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/values.yaml.tt
116
+ - lib/generators/tpt/rails/postman/postman.yaml.tt
122
117
  - lib/tpt/rails.rb
123
118
  - lib/tpt/rails/config.rb
124
119
  - lib/tpt/rails/engine.rb
@@ -132,7 +127,7 @@ homepage: https://github.com/TeachersPayTeachers/tpt-rails
132
127
  licenses:
133
128
  - Nonstandard
134
129
  metadata: {}
135
- post_install_message:
130
+ post_install_message:
136
131
  rdoc_options: []
137
132
  require_paths:
138
133
  - lib
@@ -147,8 +142,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
142
  - !ruby/object:Gem::Version
148
143
  version: '0'
149
144
  requirements: []
150
- rubygems_version: 3.0.3
151
- signing_key:
145
+ rubygems_version: 3.1.6
146
+ signing_key:
152
147
  specification_version: 4
153
148
  summary: Utils for TpT Rails apps
154
149
  test_files: []
@@ -1,10 +0,0 @@
1
- Tpt::Rails.configure do |config|
2
- config.app_name = ENV.fetch('APP_NAME')
3
- config.app_env = ENV.fetch('APP_ENV')
4
- if ENV['DOGSTATSD_URL'].present?
5
- config.datadog_statsd_url = ENV.fetch('DOGSTATSD_URL')
6
- end
7
- if ENV['DATADOG_TRACE_URL'].present?
8
- config.datadog_trace_url = ENV.fetch('DATADOG_TRACE_URL')
9
- end
10
- end
@@ -1,17 +0,0 @@
1
- class Tpt::Rails::ContinuousIntegrationGenerator < ::Rails::Generators::Base
2
- source_root File.expand_path('templates', __dir__)
3
-
4
- def setup_continuous_integration
5
- # TODO: should we run tpt cli to generate `test.config.xml`?
6
- # TODO: ask nathan about the test/tptcd/tptci files
7
- directory('ci')
8
-
9
- say(<<~MESSAGE)
10
- …note about running `tpt ci run protect.test.unit` to run tests
11
-
12
- You need to ask dev tools to create a credential in jenkins. Example ticket:
13
- https://teacherspayteachers.atlassian.net/browse/DEVT-710
14
-
15
- MESSAGE
16
- end
17
- end
@@ -1,31 +0,0 @@
1
- FROM teacherspayteachers/tptci as tptci
2
- FROM ruby:<%= RUBY_VERSION %>
3
-
4
- RUN mkdir -p /app
5
- WORKDIR /app
6
-
7
- RUN curl -sL https://deb.nodesource.com/setup_12.x | bash \
8
- && apt-get update && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* \
9
- && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
10
- && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
11
- && apt-get update && apt-get install -y yarn && apt-get install -y netcat && rm -rf /var/lib/apt/lists/*
12
-
13
- COPY package.json yarn.lock /app/
14
- RUN yarn install --check-files
15
-
16
- ENV RAILS_ENV test
17
- ENV APP_ENV test
18
- ENV APP_NAME <%= Tpt::Rails.app_name %>
19
-
20
- # GITHUB_TOKEN allows accessing our private tpt-rails gem on Github
21
- ARG GITHUB_TOKEN
22
-
23
- COPY Gemfile /app/Gemfile
24
- COPY Gemfile.lock /app/Gemfile.lock
25
- # TODO: Do we need this? Can we move it into a base image?
26
- RUN gem update bundler
27
- RUN BUNDLE_GITHUB__COM="${GITHUB_TOKEN}:x-oauth-basic" bundle install
28
-
29
- COPY . .
30
-
31
- COPY --from=tptci /usr/bin/tptci /usr/bin/tptci
@@ -1,12 +0,0 @@
1
- #!/bin/sh
2
-
3
- until nc -z -v ${MYSQL_HOSTNAME} ${MYSQL_PORT}
4
- do
5
- echo "Waiting for database connection..."
6
- sleep 5
7
- done
8
-
9
- exec bin/rails db:prepare test
10
-
11
- # Uncomment to run system tests
12
- # exec bin/rails test:system
@@ -1,40 +0,0 @@
1
- @Library('tpt-pipeline-library') _
2
-
3
- def ci = new tpt.CI(this)
4
- ci.project = '<%= Tpt::Rails.app_name %>'
5
-
6
- pipeline {
7
- agent {
8
- label 'docker-node'
9
- }
10
-
11
- environment {
12
- GITHUB_TOKEN = credentials('24caddab-590e-467f-a1d2-1c0c1864d628')
13
- }
14
-
15
- stages {
16
- stage('Start') {
17
- steps {
18
- startBuild(ci)
19
- }
20
- }
21
-
22
- stage('Build') {
23
- steps {
24
- dockerComposeBuild(ci)
25
- }
26
- }
27
-
28
- stage('Unit Test') {
29
- steps {
30
- dockerComposeRun(ci, "tests", './ci/tasks/project.test.unit')
31
- }
32
- }
33
- }
34
-
35
- post {
36
- always {
37
- finishBuild(ci, currentBuild.currentResult)
38
- }
39
- }
40
- }
@@ -1,76 +0,0 @@
1
- <?xml version='1.1' encoding='UTF-8'?><org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject plugin="workflow-multibranch@2.21">
2
- <actions/>
3
- <description></description>
4
- <displayName><%= Tpt::Rails.app_name %>-test</displayName>
5
- <properties>
6
- <org.jenkinsci.plugins.workflow.libs.FolderLibraries plugin="workflow-cps-global-lib@2.13">
7
- <libraries>
8
- <org.jenkinsci.plugins.workflow.libs.LibraryConfiguration>
9
- <name>jenkins-pipeline-library</name>
10
- <retriever class="org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever">
11
- <scm class="jenkins.plugins.git.GitSCMSource" plugin="git@3.9.3">
12
- <id>31643265-3634-6665-6262-343134326436</id>
13
- <remote>git@github.com:TeachersPayTeachers/jenkins-pipeline-library.git</remote>
14
- <credentialsId>jenkins-master-rsa-key</credentialsId>
15
- <traits>
16
- <jenkins.plugins.git.traits.BranchDiscoveryTrait/>
17
- </traits>
18
- </scm>
19
- </retriever>
20
- <implicit>false</implicit>
21
- <allowVersionOverride>true</allowVersionOverride>
22
- <includeInChangesets>true</includeInChangesets>
23
- </org.jenkinsci.plugins.workflow.libs.LibraryConfiguration>
24
- </libraries>
25
- </org.jenkinsci.plugins.workflow.libs.FolderLibraries>
26
- <org.jenkinsci.plugins.pipeline.modeldefinition.config.FolderConfig plugin="pipeline-model-definition@1.3.7">
27
- <dockerLabel/>
28
- <registry plugin="docker-commons@1.14"/>
29
- </org.jenkinsci.plugins.pipeline.modeldefinition.config.FolderConfig>
30
- </properties>
31
- <folderViews class="jenkins.branch.MultiBranchProjectViewHolder" plugin="branch-api@2.4.0">
32
- <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
33
- </folderViews>
34
- <healthMetrics>
35
- <com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric plugin="cloudbees-folder@6.8">
36
- <nonRecursive>false</nonRecursive>
37
- </com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric>
38
- <jenkins.branch.PrimaryBranchHealthMetric plugin="branch-api@2.4.0"/>
39
- </healthMetrics>
40
- <icon class="jenkins.branch.MetadataActionFolderIcon" plugin="branch-api@2.4.0">
41
- <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
42
- </icon>
43
- <orphanedItemStrategy class="com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" plugin="cloudbees-folder@6.8">
44
- <pruneDeadBranches>true</pruneDeadBranches>
45
- <daysToKeep>-1</daysToKeep>
46
- <numToKeep>5</numToKeep>
47
- </orphanedItemStrategy>
48
- <triggers/>
49
- <disabled>false</disabled>
50
- <sources class="jenkins.branch.MultiBranchProject$BranchSourceList" plugin="branch-api@2.4.0">
51
- <data>
52
- <jenkins.branch.BranchSource>
53
- <source class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source@2.4.5">
54
- <id>65633436-6138-6163-6638-323663356636</id>
55
- <credentialsId>tpt-github-source-credential</credentialsId>
56
- <repoOwner>TeachersPayTeachers</repoOwner>
57
- <repository><%= Tpt::Rails.app_name %></repository>
58
- <traits>
59
- <org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait>
60
- <strategyId>3</strategyId>
61
- </org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait>
62
- <org.jenkinsci.plugins.github__branch__source.TagDiscoveryTrait/>
63
- </traits>
64
- </source>
65
- <strategy class="jenkins.branch.DefaultBranchPropertyStrategy">
66
- <properties class="empty-list"/>
67
- </strategy>
68
- </jenkins.branch.BranchSource>
69
- </data>
70
- <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
71
- </sources>
72
- <factory class="org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory">
73
- <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
74
- <scriptPath>ci/test.Jenkinsfile</scriptPath>
75
- </factory>
76
- </org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject>
@@ -1,7 +0,0 @@
1
- @Library('tpt-pipeline-library') _
2
-
3
- def ci = new tpt.CI(this)
4
- ci.project = '<%= Tpt::Rails.app_name %>'
5
- ci.buildCredentials = [[ id: '<%= Tpt::Rails.app_name %>-rails-master-key', var: '<%= Tpt::Rails.app_name.underscore.upcase %>_RAILS_MASTER_KEY' ]]
6
-
7
- tptcdPipeline(ci: ci)
@@ -1,7 +0,0 @@
1
- @Library('tpt-pipeline-library') _
2
-
3
- def ci = new tpt.CI(this)
4
- ci.project = '<%= Tpt::Rails.app_name %>'
5
- ci.buildCredentials = [[ id: '<%= Tpt::Rails.app_name %>-rails-master-key', var: '<%= Tpt::Rails.app_name.underscore.upcase %>_RAILS_MASTER_KEY' ]]
6
-
7
- tptciPipeline(ci: ci, ode: '') // we don't need an ode, just test this service
@@ -1,41 +0,0 @@
1
- FROM ruby:<%= RUBY_VERSION %>
2
-
3
- RUN mkdir /app
4
- WORKDIR /app
5
-
6
- RUN curl -sL https://deb.nodesource.com/setup_12.x | bash \
7
- && apt-get update && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* \
8
- && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
9
- && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
10
- && apt-get update && apt-get install -y yarn && rm -rf /var/lib/apt/lists/*
11
-
12
- COPY package.json yarn.lock /app/
13
- RUN yarn install --check-files
14
-
15
- # Set production env for asset compilation
16
- ARG RAILS_ENV=production
17
- ARG APP_ENV=production
18
- ARG APP_NAME=<%= Tpt::Rails.app_name %>
19
-
20
- ARG <%= Tpt::Rails.app_name.underscore.upcase %>_RAILS_MASTER_KEY
21
- # GITHUB_TOKEN allows accessing our private tpt-rails gem on Github
22
- ARG GITHUB_TOKEN
23
-
24
- COPY Gemfile /app/Gemfile
25
- COPY Gemfile.lock /app/Gemfile.lock
26
- RUN gem update bundler
27
- RUN BUNDLE_GITHUB__COM="${GITHUB_TOKEN}:x-oauth-basic" bundle install --without development test
28
-
29
- # Add a script to be executed every time the container starts.
30
- COPY entrypoint.sh /usr/bin/
31
- RUN chmod +x /usr/bin/entrypoint.sh
32
-
33
- ADD . /app
34
-
35
- RUN RAILS_MASTER_KEY=${<%= Tpt::Rails.app_name.underscore.upcase %>_RAILS_MASTER_KEY} bin/rails assets:precompile
36
-
37
- EXPOSE 3000
38
-
39
- # TODO: Delete this?
40
- ENTRYPOINT ["entrypoint.sh"]
41
- CMD ["rails", "server", "-b", "0.0.0.0"]
@@ -1,13 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- if [ -f /app/tmp/pids/server.pid ]; then
5
- rm /app/tmp/pids/server.pid
6
- fi
7
-
8
- echo "Preparing database"
9
- # In Kubernetes this should always be a no-op because our migration hook will already have run.
10
- rails db:prepare
11
-
12
- echo "Starting server"
13
- exec "$@"
@@ -1,8 +0,0 @@
1
- dependencies:
2
- - name: mysql
3
- version: 1.3.0
4
- repository: '@stable'
5
- - name: copy-secrets
6
- version: ~1.1.0
7
- repository: https://chartmuseum.tptpm.info
8
- condition: copy-secrets.enabled
@@ -1,52 +0,0 @@
1
- name: <%= Tpt::Rails.app_name %>
2
- deploy_env: production
3
-
4
- image:
5
- name: <%= Tpt::Rails.app_name %>
6
- repository: <%= Tpt::Rails.app_name %>
7
- tag: latest
8
- pullPolicy: Always
9
-
10
- environment:
11
- ENVIRONMENT: production
12
- APP_ENV: production
13
- RAILS_ENV: production
14
-
15
- postgresql:
16
- enabled: false
17
-
18
- copy-secrets:
19
- enabled: false
20
-
21
- redis:
22
- enabled: false
23
-
24
- secrets:
25
- - name: RAILS_MASTER_KEY
26
- valueFrom:
27
- secretKeyRef:
28
- name: <%= Tpt::Rails.app_name %>-secrets
29
- key: rails-master-key
30
- - name: DATABASE_URL
31
- valueFrom:
32
- secretKeyRef:
33
- name: <%= Tpt::Rails.app_name %>-secrets
34
- # To set up a staging/prod DB:
35
- # - Create the DB in the TpT terraform repo
36
- # - Use the root DB account to create an application DB user
37
- # - Create a kube secret (e.g. prod-resource-catalog-db-url) with the DATABASE_URL
38
- # (including the application user credentials)
39
- # - Update the key below to reference your secret
40
- key: 'FIXME'
41
-
42
- autoscaler:
43
- minimumPods: 3
44
- maximumPods: 6
45
- targetCPUUtilizationPercentage: 70
46
-
47
- rollingUpdate:
48
- maxSurge: 25%
49
-
50
- # Create ELB
51
- # service:
52
- # type: LoadBalancer