potassium 5.2.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +42 -0
  3. data/.editorconfig +3 -0
  4. data/.node-version +1 -0
  5. data/.ruby-version +1 -1
  6. data/CHANGELOG.md +94 -0
  7. data/README.md +41 -47
  8. data/docs/DSL.md +5 -5
  9. data/lib/potassium/assets/.buildpacks +0 -1
  10. data/lib/potassium/assets/.circleci/config.yml.erb +102 -0
  11. data/lib/potassium/assets/.eslintrc.json +352 -0
  12. data/lib/potassium/assets/.github/pull_request_template.md +9 -0
  13. data/lib/potassium/assets/.pryrc +1 -1
  14. data/lib/potassium/assets/.rubocop.yml +515 -0
  15. data/lib/potassium/assets/.stylelintrc.json +46 -0
  16. data/lib/potassium/assets/Dockerfile.ci +1 -1
  17. data/lib/potassium/assets/Makefile.erb +35 -0
  18. data/lib/potassium/assets/Procfile +1 -0
  19. data/lib/potassium/assets/README.yml +60 -11
  20. data/lib/potassium/assets/active_admin/admin-component.vue +35 -0
  21. data/lib/potassium/assets/active_admin/admin_application.js +14 -0
  22. data/lib/potassium/assets/active_admin/init_activeadmin_vue.rb +10 -0
  23. data/lib/potassium/assets/app/graphql/graphql_controller.rb +55 -0
  24. data/lib/potassium/assets/app/graphql/mutations/login_mutation.rb +23 -0
  25. data/lib/potassium/assets/app/graphql/queries/base_query.rb +4 -0
  26. data/lib/potassium/assets/app/graphql/types/base/base_argument.rb +4 -0
  27. data/lib/potassium/assets/app/graphql/types/base/base_enum.rb +4 -0
  28. data/lib/potassium/assets/app/graphql/types/base/base_field.rb +5 -0
  29. data/lib/potassium/assets/app/graphql/types/base/base_input_object.rb +5 -0
  30. data/lib/potassium/assets/app/graphql/types/base/base_interface.rb +7 -0
  31. data/lib/potassium/assets/app/graphql/types/base/base_object.rb +5 -0
  32. data/lib/potassium/assets/app/graphql/types/base/base_scalar.rb +4 -0
  33. data/lib/potassium/assets/app/graphql/types/base/base_union.rb +4 -0
  34. data/lib/potassium/assets/app/graphql/types/mutation_type.rb +10 -0
  35. data/lib/potassium/assets/app/graphql/types/query_type.rb +13 -0
  36. data/lib/potassium/assets/app/javascript/app.spec.js +14 -0
  37. data/lib/potassium/assets/app/uploaders/base_uploader.rb +11 -0
  38. data/lib/potassium/assets/app/uploaders/image_uploader.rb +5 -0
  39. data/lib/potassium/assets/bin/cibuild.erb +24 -7
  40. data/lib/potassium/assets/bin/release +9 -0
  41. data/lib/potassium/assets/bin/setup.erb +3 -0
  42. data/lib/potassium/assets/config/database_mysql.yml.erb +5 -5
  43. data/lib/potassium/assets/config/database_postgresql.yml.erb +5 -5
  44. data/lib/potassium/assets/config/graphql_playground.rb +20 -0
  45. data/lib/potassium/assets/config/puma.rb +5 -1
  46. data/lib/potassium/assets/config/shrine.rb +36 -0
  47. data/lib/potassium/assets/docker-compose.ci.yml +2 -1
  48. data/lib/potassium/assets/docker-compose.yml +6 -0
  49. data/lib/potassium/assets/lib/tasks/auto_annotate_models.rake +34 -33
  50. data/lib/potassium/assets/package.json +4 -1
  51. data/lib/potassium/assets/redis.yml +1 -2
  52. data/lib/potassium/assets/sidekiq_scheduler.yml +1 -1
  53. data/lib/potassium/assets/testing/rails_helper.rb +4 -2
  54. data/lib/potassium/cli/commands/create.rb +12 -19
  55. data/lib/potassium/cli_options.rb +67 -24
  56. data/lib/potassium/helpers/docker-helpers.rb +14 -5
  57. data/lib/potassium/helpers/gem-helpers.rb +1 -1
  58. data/lib/potassium/helpers/template-helpers.rb +4 -0
  59. data/lib/potassium/newest_version_ensurer.rb +19 -36
  60. data/lib/potassium/node_version_ensurer.rb +30 -0
  61. data/lib/potassium/recipes/admin.rb +3 -3
  62. data/lib/potassium/recipes/annotate.rb +1 -1
  63. data/lib/potassium/recipes/api.rb +93 -21
  64. data/lib/potassium/recipes/background_processor.rb +38 -2
  65. data/lib/potassium/recipes/ci.rb +8 -6
  66. data/lib/potassium/recipes/data_migrate.rb +44 -0
  67. data/lib/potassium/recipes/database.rb +6 -2
  68. data/lib/potassium/recipes/database_container.rb +90 -0
  69. data/lib/potassium/recipes/draper.rb +1 -10
  70. data/lib/potassium/recipes/file_storage.rb +66 -0
  71. data/lib/potassium/recipes/front_end.rb +219 -9
  72. data/lib/potassium/recipes/github.rb +93 -15
  73. data/lib/potassium/recipes/heroku.rb +2 -1
  74. data/lib/potassium/recipes/listen.rb +7 -0
  75. data/lib/potassium/recipes/mailer.rb +14 -4
  76. data/lib/potassium/recipes/node.rb +21 -0
  77. data/lib/potassium/recipes/puma.rb +0 -3
  78. data/lib/potassium/recipes/rack_cors.rb +18 -15
  79. data/lib/potassium/recipes/rails.rb +6 -0
  80. data/lib/potassium/recipes/schedule.rb +1 -1
  81. data/lib/potassium/recipes/style.rb +21 -3
  82. data/lib/potassium/recipes/vue_admin.rb +124 -0
  83. data/lib/potassium/templates/application.rb +10 -9
  84. data/lib/potassium/version.rb +7 -4
  85. data/potassium.gemspec +9 -6
  86. data/spec/features/api_spec.rb +25 -0
  87. data/spec/features/background_processor_spec.rb +12 -1
  88. data/spec/features/data_migrate_spec.rb +14 -0
  89. data/spec/features/database_container_spec.rb +35 -0
  90. data/spec/features/draper_spec.rb +1 -6
  91. data/spec/features/file_storage_spec.rb +75 -0
  92. data/spec/features/front_end_spec.rb +88 -0
  93. data/spec/features/github_spec.rb +53 -8
  94. data/spec/features/graphql_spec.rb +71 -0
  95. data/spec/features/heroku_spec.rb +8 -5
  96. data/spec/features/mailer_spec.rb +42 -0
  97. data/spec/features/new_project_spec.rb +6 -14
  98. data/spec/features/node_spec.rb +28 -0
  99. data/spec/features/power_types_spec.rb +5 -16
  100. data/spec/features/vue_admin_spec.rb +47 -0
  101. data/spec/spec_helper.rb +5 -0
  102. data/spec/support/fake_octokit.rb +31 -0
  103. data/spec/support/potassium_test_helpers.rb +26 -8
  104. metadata +126 -45
  105. data/circle.yml +0 -12
  106. data/lib/potassium/assets/.circleci/config.yml +0 -20
  107. data/lib/potassium/assets/active_admin/active_admin.js.coffee +0 -4
  108. data/lib/potassium/assets/active_admin/init_activeadmin_angular.rb +0 -8
  109. data/lib/potassium/assets/api/api_error_concern.rb +0 -32
  110. data/lib/potassium/assets/api/base_controller.rb +0 -9
  111. data/lib/potassium/assets/api/draper_responder.rb +0 -62
  112. data/lib/potassium/assets/api/responder.rb +0 -41
  113. data/lib/potassium/assets/aws.rb +0 -1
  114. data/lib/potassium/assets/testing/paperclip.rb +0 -59
  115. data/lib/potassium/recipes/active_storage.rb +0 -40
  116. data/lib/potassium/recipes/angular_admin.rb +0 -56
  117. data/lib/potassium/recipes/aws_sdk.rb +0 -7
  118. data/lib/potassium/recipes/paperclip.rb +0 -47
  119. data/spec/features/active_storage_spec.rb +0 -30
  120. data/spec/features/front_end.rb +0 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 586c6642ed62cba7a9a9aadba36fc53ea14f3dda6bd182c1e4e66e5818a4c19f
4
- data.tar.gz: 8d12fa2fbf200d8664945c8187c4d257e3a5b5285057032a95eacb03ad088be4
3
+ metadata.gz: f0a1ede8a865324db5e181ed3cfbf3c9e1f96484caadc5c029b6c5175efc7e6b
4
+ data.tar.gz: 8639acb5ea81cfdc85d98d14db0a01be36eaca1af890091784e04b29f6680a9f
5
5
  SHA512:
6
- metadata.gz: 60726b985ce4c24e7be3f92ecb9f8f9532b171b995768eef00e3afc8aa4ab6480d7f39a48efcb4a2b4da0d48154caa2f66a5f4eea5cf9269569c5955a7155fa3
7
- data.tar.gz: 8bb3ee2bac542101adc27bc41a5ea6823cbb6a94a0a76bbcff731a3139c8d050f6b7d3d8ca8ba7b1715bb64b269999c0e393d5d712e278f745ccbbadfad24479
6
+ metadata.gz: 239fc6414dc246862c5cfedfa12a5a182e11b79897b8309e7d0f12c0cb500ef06e919b5dadf6c2f78eaf30f53de14eef923ba2992ee23f6765b055dd667d9136
7
+ data.tar.gz: 4d25beae0b7803c49cda4d35c573922c310f9a48003044fece122a87b020c75cbfc89efd8b4861bac90d7a8a8ff42496322155e1ead2c9b6214d49700e0eb994
@@ -0,0 +1,42 @@
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ working_directory: ~/app
5
+ parallelism: 4
6
+ shell: /bin/bash --login
7
+
8
+ docker:
9
+ - image: circleci/ruby:2.7.0-node
10
+ environment:
11
+ GEM_HOME: /home/circleci/app/vendor/bundle
12
+ BUNDLE_JOBS: 4
13
+ BUNDLE_RETRY: 3
14
+ BUNDLE_PATH: /home/circleci/app/vendor/bundle
15
+
16
+ steps:
17
+ - checkout
18
+ - setup_remote_docker
19
+
20
+ - restore_cache:
21
+ keys:
22
+ - potassium-bundle-{{ .Branch }}-
23
+ - potassium-bundle-master-
24
+ - potassium-bundle-
25
+ - run: gem install bundler:2.0.2
26
+ - run: bundle _2.0.2_ install
27
+ - run: gem install hound-cli
28
+ - run:
29
+ command: |
30
+ bundle exec rspec --color --require spec_helper --profile 10 \
31
+ --format progress --format documentation \
32
+ --format RspecJunitFormatter --out test_results/rspec.xml \
33
+ $(circleci tests glob spec/**/*_spec.rb | circleci tests split --split-by=timings)
34
+ environment:
35
+ RAILS_ENV: test
36
+ RACK_ENV: test
37
+ - save_cache:
38
+ key: potassium-bundle-{{ .Branch }}-{{ epoch }}
39
+ paths:
40
+ - vendor/bundle
41
+ - store_test_results:
42
+ path: test_results
@@ -22,3 +22,6 @@ indent_size = 2
22
22
 
23
23
  [*.md]
24
24
  trim_trailing_whitespace = false
25
+
26
+ [Makefile]
27
+ indent_style = tab
@@ -0,0 +1 @@
1
+ 12
@@ -1 +1 @@
1
- 2.5
1
+ 2.7
@@ -2,6 +2,100 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 6.1.0
6
+
7
+ Features:
8
+ - Check node version before project creation [#305](https://github.com/platanus/potassium/pull/305)
9
+ - Disable observers in test environment [#319](https://github.com/platanus/potassium/pull/319)
10
+ - Allow user to select custom Github repository [#318](https://github.com/platanus/potassium/pull/318)
11
+ - Add pull request template to github enabled projects [#320](https://github.com/platanus/potassium/pull/320)
12
+ - Use a Ruby gem instead of hub to create Github repositories [#323](https://github.com/platanus/potassium/pull/323)
13
+ - Add dockerized redis configuration when using background processor [#329](https://github.com/platanus/potassium/pull/329)
14
+ - Add beta support for GraphQL. [#330](https://github.com/platanus/potassium/pull/330)
15
+ - Add power_api [#301](https://github.com/platanus/potassium/pull/301)
16
+
17
+
18
+ Fix:
19
+ - Fix shrine issues related to configuration and uploader validation [#302](https://github.com/platanus/potassium/pull/302)
20
+ - Fix database recipe not running recommended generator for strong_migrations gem [#310](https://github.com/platanus/potassium/pull/310)
21
+ - Fix puma config that was causing it to crash on server start while on development [#313](https://github.com/platanus/potassium/pull/313)
22
+ - Fix purge css being enabled in development [#327](https://github.com/platanus/potassium/pull/327)
23
+
24
+ ## 6.0.0
25
+
26
+ Features:
27
+ - Update ActiveAdmin to 2.6 [#246](https://github.com/platanus/potassium/pull/246)
28
+ - Update bundler to 2.0 [#250](https://github.com/platanus/potassium/pull/250)
29
+ - Update Rails to 6.0.2 [#251](https://github.com/platanus/potassium/pull/251)
30
+ - Improve specs performance [#259](https://github.com/platanus/potassium/pull/259)
31
+ - Dasherize app name in docker compose related files [#261](https://github.com/platanus/potassium/pull/261)
32
+ - Split specs by timings in CircleCI [#263](https://github.com/platanus/potassium/pull/263)
33
+ - Update ruby to 2.7.0 [#264](https://github.com/platanus/potassium/pull/264)
34
+ - Add tailwindcss [#266](https://github.com/platanus/potassium/pull/266)
35
+ - Update rack-cors to 1.1 [#269](https://github.com/platanus/potassium/pull/269)
36
+ - Use safer CORS configuration exposing only API and public resources [#271](https://github.com/platanus/potassium/pull/271)
37
+ - Add option to support Vue in ActiveAdmin [#272](https://github.com/platanus/potassium/pull/272)
38
+ - Add tests for Vue [#273](https://github.com/platanus/potassium/pull/278)
39
+ - Remove simple commands and docker-compose args in Makefile [#279](https://github.com/platanus/potassium/pull/279)
40
+ - Remove Paperclip and add [Shrine](https://github.com/shrinerb/shrine) for file_storage recipe [#291](https://github.com/platanus/potassium/pull/291)
41
+ - Add linting job to CircleCI builds using [reviewdog](https://github.com/reviewdog/reviewdog) and per-project dependencies/configurations for linters [#292](https://github.com/platanus/potassium/pull/292)
42
+ - Remove angular_admin recipe [#297](https://github.com/platanus/potassium/pull/297)
43
+
44
+ Fix:
45
+ - Correctly use cache for bundle dependencies in CircleCI build [#244](https://github.com/platanus/potassium/pull/244) and [#258](https://github.com/platanus/potassium/pull/258)
46
+ - Fix model auto annotate [#260](https://github.com/platanus/potassium/pull/260)
47
+ - Fix sidekiq repeated installation on potassium create if selecting mailer [#262](https://github.com/platanus/potassium/pull/262)
48
+ - Include ApiErrorConcern in all environments [#270](https://github.com/platanus/potassium/pull/270)
49
+
50
+ ## 5.2.3
51
+
52
+ Features:
53
+ - Add restore-from commands for pg_restore in makefile [#237](https://github.com/platanus/potassium/pull/237)
54
+ - Allow usage of vue components in rails views out of the box [#231](https://github.com/platanus/potassium/pull/231)
55
+ - Add data migrate [#227](https://github.com/platanus/potassium/pull/227)
56
+ - Add raven capture in error handler if sentry enabled [#226](https://github.com/platanus/potassium/pull/226)
57
+ - Remove unnecesary aws-sdk gems in favor of specific ones [#221](https://github.com/platanus/potassium/pull/221)
58
+ - Unify storage options and deprecate paperclip [#211](https://github.com/platanus/potassium/pull/211)
59
+
60
+ Fix:
61
+ - Fix gather_gem issue when multiple versions passed as argument [#242](https://github.com/platanus/potassium/pull/242)
62
+ - Support "None" passed as CLI flag option in file storage [#240](https://github.com/platanus/potassium/pull/240)
63
+ - Add sidekiq worker to Procfile if installed after project setup (with heroku) [#234](https://github.com/platanus/potassium/pull/234)
64
+ - Include test_data volume to CI compose for bundler related data [#229](https://github.com/platanus/potassium/pull/229)
65
+ - Comment out schedule entry in sidekiq.yml [#225](https://github.com/platanus/potassium/pull/225)
66
+ - Use ruby image for potassium test build [#224](https://github.com/platanus/potassium/pull/224)
67
+ - Use webpacker from rubygems instead of repo master [#222](https://github.com/platanus/potassium/pull/222)
68
+ - Add rubocop-rspec for compatibility with updated linters in spec [#218](https://github.com/platanus/potassium/pull/218)
69
+ - Remove containers after spec run [#216](https://github.com/platanus/potassium/pull/216)
70
+ - Fix database container install [#214](https://github.com/platanus/potassium/pull/214)
71
+
72
+ ## 5.2.2
73
+
74
+ Features:
75
+ - Implement release phase on heroku
76
+ - Add sendgrid_dev support
77
+
78
+ Fix:
79
+ - Fix Circle CI
80
+ - Fix services containers env variables
81
+
82
+ ## 5.2.1
83
+
84
+ Features:
85
+ - Databases are now provided as docker containers
86
+
87
+ Changes:
88
+ - Update postgres to 11
89
+ - Update mysql to 5.7
90
+ - Update rubocop to `~> 0.65.0`
91
+ - Puma worker timeout is extended to 1 day in development env
92
+ - Spring is loaded only in development env
93
+ - Remove version requirement for `pg`
94
+
95
+ Fix:
96
+ - Update mysql2 to `~> 0.5.0` (required for rails 5+)
97
+ - Use `RACK_TIMEOUT` env var instead deprecated setter
98
+
5
99
  ## 5.2.0
6
100
 
7
101
  Features:
data/README.md CHANGED
@@ -16,7 +16,10 @@ Use the `potassium create` command to create a new project:
16
16
 
17
17
  $ potassium create <project-name>
18
18
 
19
- > It's important to note that it will perform a version check before running to ensure that you're using the latest potassium. Also, if you feel that it's too slow, you may need to update rubygems: `gem update --system`.
19
+ > Please note:
20
+ > 1. Potassium will perform a version check before running to ensure that you are using the latest potassium.
21
+ > 2. If you feel that it's too slow, you may need to update rubygems: `gem update --system`.
22
+ > 3. Potassium uses node under the hood, so a check will also be performed to ensure you are running the supported version.
20
23
 
21
24
  ### Adding recipes to an existing project
22
25
 
@@ -36,41 +39,40 @@ You can run the command on its own to view all the available recipes and select
36
39
 
37
40
  Potassium Rails apps includes the following gems and technologies:
38
41
 
39
- - [Ruby](https://www.ruby-lang.org) Set the project ruby version based on http://ruby.platan.us/latest
40
- - [dotenv](https://github.com/bkeepers/dotenv) load environmental variables in development
41
- - [Yarn](https://yarnpkg.com) for frontend assets packages.
42
- - [EditorConfig](http://editorconfig.org) for keeping all our editor configurations the same.
43
- - [pry](http://pryrepl.org) and [pry-byebug](https://github.com/deivid-rodriguez/pry-byebug) for a less painful debugging experience.
44
- - [RSpec](http://rspec.info) for unit and integration testing.
45
- - [FactoryBot](https://github.com/thoughtbot/factory_bot] for test factories.
46
- - [Guard](http://guardgem.org) for continuous testing and other watch-related tasks.
47
- - [AWS-SDK](https://github.com/aws/aws-sdk-ruby) for file uploads, sdks, etc and because we use AWS.
42
+ - [dotenv](https://github.com/bkeepers/dotenv) for loading environmental variables in development
43
+ - [Yarn](https://yarnpkg.com) for frontend assets packages
44
+ - [EditorConfig](http://editorconfig.org) for keeping all our editor configurations the same
45
+ - [pry](http://pryrepl.org) and [pry-byebug](https://github.com/deivid-rodriguez/pry-byebug) for a less painful debugging experience
46
+ - [RSpec](http://rspec.info) for unit and integration testing
47
+ - [FactoryBot](https://github.com/thoughtbot/factory_bot) for test factories
48
+ - [Guard](http://guardgem.org) for continuous testing and other watch-related tasks
49
+ - [AWS-SDK](https://github.com/aws/aws-sdk-ruby) for file uploads, sdks, etc and because we use AWS
48
50
  - [Puma](https://github.com/puma/puma) to serve HTTP requests
49
51
  - [Rack Timeout](https://github.com/heroku/rack-timeout) to abort requests that are
50
52
  taking too long
51
- - [Tzinfo-Data](https://github.com/tzinfo/tzinfo-data) for update timezone information
52
- - [Faker](https://github.com/stympy/faker) for create development data
53
-
54
- The following optional integrations are added too:
55
-
56
- - [PostgreSQL](http://www.postgresql.org) or [MySQL](https://www.mysql.com) for the database.
57
- - [Devise](https://github.com/plataformatec/devise) for authentication.
58
- - [ActiveAdmin](http://activeadmin.info) for admin interfaces.
59
- - [ActiveAdminAddons](https://github.com/platanus/activeadmin_addons) for some help with ActiveAdmin.
60
- - [Pundit](https://github.com/elabs/pundit) for role-based authorization.
61
- - [DelayedJob](https://github.com/collectiveidea/delayed_job) to execute longer tasks in the background.]
62
- - [Sidekiq](https://github.com/mperham/sidekiq) a simple, efficient background processing for Ruby.
53
+ - [Tzinfo-Data](https://github.com/tzinfo/tzinfo-data) for updating timezone information
54
+ - [Faker](https://github.com/stympy/faker) for creating development data
55
+
56
+ The following optional integrations are also added:
57
+
58
+ - [PostgreSQL](http://www.postgresql.org) or [MySQL](https://www.mysql.com) for the database
59
+ - [Devise](https://github.com/plataformatec/devise) for authentication
60
+ - [ActiveAdmin](http://activeadmin.info) for admin interfaces
61
+ - [ActiveAdminAddons](https://github.com/platanus/activeadmin_addons) for some help with ActiveAdmin
62
+ - [Pundit](https://github.com/elabs/pundit) for role-based authorization
63
+ - [DelayedJob](https://github.com/collectiveidea/delayed_job) to execute longer tasks in the background
64
+ - [Sidekiq](https://github.com/mperham/sidekiq) a simple, efficient background processing for Ruby
63
65
  - [Sidekiq-scheduler](https://github.com/moove-it/sidekiq-scheduler) to run scheduled processes
64
66
  - Mailing configuration for [AWS SES](https://github.com/aws/aws-sdk-rails)
65
67
  and [Sendgrid](https://github.com/platanus/send_grid_mailer) with recipient interceptor support
66
68
  - [Sentry](https://sentry.io) to monitor exceptions and errors
67
69
  - [Vue.js](https://vuejs.org) or [Angular 2](https://angular.io/) for frontend development
70
+ - Creates the Github repository of your choice for the project. A local git repository will always be created.
68
71
 
69
72
  A few more things are added to the project:
70
73
 
71
74
  - A [low database connection pool limit][pool]
72
- - Setup continuous integration in [CircleCI](circle-ci) to run tests.
73
- - Create the github repository for the project (it used `hub` under the hood)
75
+ - Setup continuous integration in [CircleCI](circle-ci) to run tests
74
76
  - A `bin/setup` script to setup things on a newly cloned project
75
77
  - A `bin/cibuild` script to run continuous integration build on CI
76
78
  - A `db:fake_data:load` rake task to load fake data for development
@@ -81,39 +83,34 @@ A few more things are added to the project:
81
83
 
82
84
  The optional API support includes:
83
85
 
84
- - [Responders](https://github.com/plataformatec/responders) for dry-ing our api controllers.
85
- - [Versionist](https://github.com/bploetz/versionist) for some flexible api versioning.
86
- - [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) for record serialization.
87
- - [Simple Token Authentication](https://github.com/gonzalo-bulnes/simple_token_authentication) for stateless API authentication.
86
+ - [Responders](https://github.com/plataformatec/responders) for dry-ing our api controllers
87
+ - [Versionist](https://github.com/bploetz/versionist) for some flexible api versioning
88
+ - [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) for record serialization
89
+ - [Simple Token Authentication](https://github.com/gonzalo-bulnes/simple_token_authentication) for stateless API authentication
88
90
 
89
91
  ### Heroku
90
92
 
91
93
  When you choose to deploy to heroku a few extra things are added for the project.
92
94
 
93
- - Adds the [Rails Stdout Logging][logging-gem] gem
94
- to configure the app to log to standard out,
95
- which is how [Heroku's logging][heroku-logging] works.
95
+ - Adds the [Rails Stdout Logging][logging-gem] gem to configure the app to log to standard out, which is how [Heroku's logging][heroku-logging] works
96
96
  - Adds a [Procfile][procfile] to define the processes to run in heroku
97
- - Setup continuous integration using docker and herokuish to maintain better
98
- parity between testing and production environments
99
- - Adds a `.buildpacks` file with the default buildpacks to use. It use the
100
- following buildpacks:
97
+ - Setup continuous integration using docker and herokuish to maintain better parity between testing and production environments
98
+ - Adds a `bin/release` file with the release phase script to run specific tasks before the app is deployed completely, for example `rails db:migrate:with_data`
99
+ - Adds a `.buildpacks` file with the default buildpacks to use. It use the following buildpacks:
101
100
 
102
101
  | index | buildpack | description |
103
102
  |-------|-----------|-------------|
104
103
  | 1. | [nodejs][heroku-buildpack-nodejs] | to support javascript package management with `yarn` and `webpack` based asset compiling |
105
104
  | 2. | [ruby-version][heroku-buildpack-ruby-version] | to support the use of `.ruby-version` file to instruct heroku which ruby version to use |
106
105
  | 3. | [ruby][heroku-buildpack-ruby] | the base buildpack to run ruby applications |
107
- | 4. | [ruby-deploy-tasks][buildpack-deploy-tasks] | to run rake task after the deployment is complete, for example `db:migrate` |
108
106
 
109
107
  Also the heroku applications are created
110
108
 
111
109
  - Creates a `staging` and `production` applications
112
110
  - Creates a pipeline and assign the above application to the `staging`
113
- and `production` stages.
111
+ and `production` stages
114
112
  - Setup initial configuration variables
115
113
  - Set the application buildpack to the [multi-buildpack][heroku-buildpack-multi]
116
- - Set **deploy-tasks** buildpack is setup to run `rake db:migrate` after each deploy
117
114
 
118
115
  You'll need to manually
119
116
 
@@ -127,11 +124,9 @@ In order to CicleCI start building the project on each push you need tell circle
127
124
  Go to https://circleci.com/add-projects, choose the repository from the list and hit
128
125
  **Build Project**
129
126
 
130
- ### Hound CI
127
+ #### ReviewDog
131
128
 
132
- In order to Hound start checking your project's PRs you need enable that repository.
133
- Go to https://monkeyci.platan.us, choose the repository from the list and hit
134
- **Activate**
129
+ In order to enable code linting via CircleCI and ReviewDog, you need to activate the **Only build pull requests** option under the `Advanced settings` section for your project.
135
130
 
136
131
  [logging-gem]: https://github.com/heroku/rails_stdout_logging
137
132
  [heroku-logging]: https://devcenter.heroku.com/articles/logging#writing-to-your-log
@@ -140,7 +135,6 @@ Go to https://monkeyci.platan.us, choose the repository from the list and hit
140
135
  [heroku-buildpack-nodejs]: https://github.com/heroku/heroku-buildpack-nodejs
141
136
  [heroku-buildpack-ruby]: http://github.com/heroku/heroku-buildpack-ruby
142
137
  [heroku-buildpack-multi]: http://github.com/heroku/heroku-buildpack-multi
143
- [buildpack-deploy-tasks]: http://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks
144
138
  [circle-ci]: https://circleci.com
145
139
 
146
140
  ## Development Tools
@@ -151,13 +145,13 @@ This is useful when you are adding new recipes to Potassium, and you want to use
151
145
  To achieve this you need to run, **In the Potassium's root path**, the `bin/potassium_test create` instead of `potassium create` command.
152
146
  This command, will do the same as `potassium create` but first:
153
147
 
154
- - Will drop any existent database of the test app.
155
- - Will remove the directory containing a previous version of the test app.
148
+ - Will drop any existent database of the test app
149
+ - Will remove the directory containing a previous version of the test app
156
150
 
157
151
  It's important to remember that `bin/potassium_test create`:
158
152
 
159
153
  - Does not receive an `app_path` param. It always creates the test project inside `/tmp/dummy_app`
160
- - Can receive the same options as `potassium create`.
154
+ - Can receive the same options as `potassium create`
161
155
  - Runs with options with a default value. This is to avoid the "asking part" of the creation process. You need to enable what you want to test like this: `$ bin/potassium_test create --clockwork`
162
156
 
163
157
  ## Contributing
@@ -175,4 +169,4 @@ potassium is maintained by [platanus](http://platan.us).
175
169
 
176
170
  ## License
177
171
 
178
- Potassium is © 2014 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.
172
+ Potassium is © 2014 Platanus, SPA. It is free software and may be redistributed under the terms specified in the LICENSE file.
@@ -308,7 +308,7 @@ add_readme_header(:style_guide)
308
308
 
309
309
  ##### | `add_readme_section(header, section, iterpolation_values)`
310
310
 
311
- To add header's sections. Paperclip, for example:
311
+ To add header's sections. Devise, for example:
312
312
 
313
313
  ```yml
314
314
  readme:
@@ -316,11 +316,11 @@ readme:
316
316
  internal_dependencies:
317
317
  title: "Internal dependencies"
318
318
  sections:
319
- paperclip:
320
- title: "Uploads"
321
- body: "For managing uploads, this project uses..."
319
+ devise:
320
+ title: "Authentication"
321
+ body: "We are using the great..."
322
322
  ```
323
323
 
324
324
  ```ruby
325
- add_readme_section(:internal_dependencies, :paperclip)
325
+ add_readme_section(:internal_dependencies, :devise)
326
326
  ```
@@ -1,3 +1,2 @@
1
1
  https://github.com/platanus/heroku-buildpack-ruby-version.git
2
2
  https://github.com/heroku/heroku-buildpack-ruby.git
3
- https://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks.git
@@ -0,0 +1,102 @@
1
+ version: 2
2
+ jobs:
3
+ test:
4
+ working_directory: ~/app
5
+
6
+ docker:
7
+ - image: platanus/compose:1.22.0
8
+
9
+ steps:
10
+ - checkout
11
+ - setup_remote_docker
12
+
13
+ - run: docker info
14
+ - run: docker-compose -f docker-compose.ci.yml pull
15
+ - run: docker-compose -f docker-compose.ci.yml build test
16
+ - run: bin/cibuild services
17
+ - run: bin/cibuild deps
18
+
19
+ - run: bin/cibuild db
20
+ - run: bin/cibuild tests
21
+ <% if selected?(:front_end, :vue) %>
22
+ - run: bin/cibuild js_tests
23
+ <% end %>
24
+
25
+ lint:
26
+ docker:
27
+ - image: circleci/ruby:2.7-node
28
+ environment:
29
+ BUNDLE_JOBS: 4
30
+ BUNDLE_RETRY: 3
31
+ BUNDLE_PATH: vendor/bundle
32
+ steps:
33
+ - checkout
34
+
35
+ - restore_cache:
36
+ keys:
37
+ - bundle-dependencies-{{ checksum "Gemfile.lock" }}
38
+ - bundle-dependencies-
39
+
40
+ - restore_cache:
41
+ keys:
42
+ - yarn-dependencies-{{ checksum "yarn.lock" }}
43
+ - yarn-dependencies-
44
+
45
+ - run:
46
+ name: Install bundle dependencies
47
+ command: |
48
+ BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")
49
+ gem install bundler:$BUNDLER_VERSION
50
+ bundle _$(echo $BUNDLER_VERSION)_ install
51
+
52
+ - save_cache:
53
+ key: bundle-dependencies-{{ checksum "Gemfile.lock" }}
54
+ paths:
55
+ - vendor/bundle
56
+
57
+ - run:
58
+ name: Install yarn dependencies
59
+ command: yarn install --frozen-lockfile
60
+
61
+ - save_cache:
62
+ key: yarn-dependencies-{{ checksum "yarn.lock" }}
63
+ paths:
64
+ - node_modules
65
+
66
+ - run:
67
+ name: Install reviewdog
68
+ command: |
69
+ curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ./bin
70
+
71
+ - run:
72
+ name: Get files to lint
73
+ command: git diff origin/master --name-only --diff-filter=d > tmp/files_to_lint
74
+
75
+ - run:
76
+ name: Run rubocop
77
+ shell: /bin/bash
78
+ command: |
79
+ cat tmp/files_to_lint | grep -E '.+\.(rb)$' | xargs bundle exec rubocop --force-exclusion \
80
+ | ./bin/reviewdog -reporter=github-pr-review -f=rubocop
81
+
82
+ - run:
83
+ name: Run eslint
84
+ shell: /bin/bash
85
+ command: |
86
+ cat tmp/files_to_lint | grep -E '.+\.(js|jsx|vue)$' | xargs yarn run eslint \
87
+ | ./bin/reviewdog -reporter=github-pr-review -f=eslint
88
+
89
+ - run:
90
+ name: Run stylelint
91
+ shell: /bin/bash
92
+ command: |
93
+ cat tmp/files_to_lint | grep -E '.+\.(scss|css|less)$' | xargs yarn run stylelint \
94
+ | ./bin/reviewdog -reporter=github-pr-review -f=stylelint
95
+
96
+ workflows:
97
+ version: 2
98
+ test_and_lint:
99
+ jobs:
100
+ - test
101
+ - lint:
102
+ context: org-global