potassium 5.2.2 → 6.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +103 -28
- data/.circleci/setup-rubygems.sh +3 -0
- data/.gitignore +2 -1
- data/.node-version +1 -0
- data/.rubocop.yml +530 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +92 -1
- data/README.md +51 -45
- data/docs/DSL.md +5 -5
- data/lib/potassium/assets/.circleci/config.yml.erb +151 -0
- data/lib/potassium/assets/.eslintrc.json +352 -0
- data/lib/potassium/assets/.github/pull_request_template.md +9 -0
- data/lib/potassium/assets/.rubocop.yml +528 -0
- data/lib/potassium/assets/.stylelintrc.json +46 -0
- data/lib/potassium/assets/Makefile.erb +21 -32
- data/lib/potassium/assets/README.yml +59 -15
- data/lib/potassium/assets/active_admin/admin-component.vue +35 -0
- data/lib/potassium/assets/active_admin/admin_application.js +14 -0
- data/lib/potassium/assets/active_admin/init_activeadmin_vue.rb +10 -0
- data/lib/potassium/assets/app/graphql/graphql_controller.rb +55 -0
- data/lib/potassium/assets/app/graphql/mutations/login_mutation.rb +23 -0
- data/lib/potassium/assets/app/graphql/queries/base_query.rb +4 -0
- data/lib/potassium/assets/app/graphql/types/base/base_argument.rb +4 -0
- data/lib/potassium/assets/app/graphql/types/base/base_enum.rb +4 -0
- data/lib/potassium/assets/app/graphql/types/base/base_field.rb +5 -0
- data/lib/potassium/assets/app/graphql/types/base/base_input_object.rb +5 -0
- data/lib/potassium/assets/app/graphql/types/base/base_interface.rb +7 -0
- data/lib/potassium/assets/app/graphql/types/base/base_object.rb +5 -0
- data/lib/potassium/assets/app/graphql/types/base/base_scalar.rb +4 -0
- data/lib/potassium/assets/app/graphql/types/base/base_union.rb +4 -0
- data/lib/potassium/assets/app/graphql/types/mutation_type.rb +10 -0
- data/lib/potassium/assets/app/graphql/types/query_type.rb +13 -0
- data/lib/potassium/assets/app/javascript/app.spec.js +14 -0
- data/lib/potassium/assets/app/uploaders/base_uploader.rb +11 -0
- data/lib/potassium/assets/app/uploaders/image_uploader.rb +5 -0
- data/lib/potassium/assets/app/views/shared/_gtm_body.html.erb +4 -0
- data/lib/potassium/assets/app/views/shared/_gtm_head.html.erb +7 -0
- data/lib/potassium/assets/bin/release +1 -1
- data/lib/potassium/assets/bin/setup.erb +1 -1
- data/lib/potassium/assets/config/database_mysql.yml.erb +2 -2
- data/lib/potassium/assets/config/database_postgresql.yml.erb +2 -2
- data/lib/potassium/assets/config/graphql_playground.rb +20 -0
- data/lib/potassium/assets/config/puma.rb +1 -1
- data/lib/potassium/assets/config/shrine.rb +36 -0
- data/lib/potassium/assets/lib/tasks/auto_annotate_models.rake +2 -1
- data/lib/potassium/assets/package.json +4 -1
- data/lib/potassium/assets/redis.yml +1 -2
- data/lib/potassium/assets/testing/rails_helper.rb +2 -0
- data/lib/potassium/cli/commands/create.rb +12 -19
- data/lib/potassium/cli_options.rb +77 -26
- data/lib/potassium/helpers/gem-helpers.rb +1 -1
- data/lib/potassium/helpers/template-helpers.rb +8 -0
- data/lib/potassium/newest_version_ensurer.rb +19 -36
- data/lib/potassium/node_version_ensurer.rb +30 -0
- data/lib/potassium/recipes/admin.rb +3 -3
- data/lib/potassium/recipes/annotate.rb +1 -1
- data/lib/potassium/recipes/api.rb +93 -21
- data/lib/potassium/recipes/background_processor.rb +66 -19
- data/lib/potassium/recipes/ci.rb +10 -38
- data/lib/potassium/recipes/data_migrate.rb +44 -0
- data/lib/potassium/recipes/database.rb +4 -0
- data/lib/potassium/recipes/database_container.rb +7 -5
- data/lib/potassium/recipes/draper.rb +1 -10
- data/lib/potassium/recipes/file_storage.rb +66 -0
- data/lib/potassium/recipes/front_end.rb +225 -9
- data/lib/potassium/recipes/github.rb +93 -15
- data/lib/potassium/recipes/google_tag_manager.rb +90 -0
- data/lib/potassium/recipes/heroku.rb +42 -29
- data/lib/potassium/recipes/mailer.rb +18 -2
- data/lib/potassium/recipes/monitoring.rb +5 -0
- data/lib/potassium/recipes/node.rb +21 -0
- data/lib/potassium/recipes/rack_cors.rb +18 -15
- data/lib/potassium/recipes/schedule.rb +17 -2
- data/lib/potassium/recipes/style.rb +21 -3
- data/lib/potassium/recipes/vue_admin.rb +124 -0
- data/lib/potassium/templates/application.rb +10 -7
- data/lib/potassium/version.rb +7 -4
- data/potassium.gemspec +11 -6
- data/spec/features/api_spec.rb +25 -0
- data/spec/features/background_processor_spec.rb +19 -6
- data/spec/features/ci_spec.rb +7 -4
- data/spec/features/data_migrate_spec.rb +14 -0
- data/spec/features/database_container_spec.rb +1 -5
- data/spec/features/draper_spec.rb +1 -6
- data/spec/features/file_storage_spec.rb +75 -0
- data/spec/features/front_end_spec.rb +102 -0
- data/spec/features/github_spec.rb +53 -8
- data/spec/features/google_tag_manager_spec.rb +59 -0
- data/spec/features/graphql_spec.rb +71 -0
- data/spec/features/heroku_spec.rb +1 -1
- data/spec/features/mailer_spec.rb +16 -0
- data/spec/features/new_project_spec.rb +6 -14
- data/spec/features/node_spec.rb +28 -0
- data/spec/features/power_types_spec.rb +5 -16
- data/spec/features/schedule_spec.rb +11 -4
- data/spec/features/vue_admin_spec.rb +47 -0
- data/spec/spec_helper.rb +5 -0
- data/spec/support/fake_octokit.rb +31 -0
- data/spec/support/potassium_test_helpers.rb +26 -9
- data/tmp/.keep +0 -0
- metadata +152 -46
- data/lib/potassium/assets/.circleci/config.yml +0 -20
- data/lib/potassium/assets/Dockerfile.ci +0 -6
- data/lib/potassium/assets/active_admin/active_admin.js.coffee +0 -4
- data/lib/potassium/assets/active_admin/init_activeadmin_angular.rb +0 -8
- data/lib/potassium/assets/api/api_error_concern.rb +0 -32
- data/lib/potassium/assets/api/base_controller.rb +0 -9
- data/lib/potassium/assets/api/draper_responder.rb +0 -62
- data/lib/potassium/assets/api/responder.rb +0 -41
- data/lib/potassium/assets/aws.rb +0 -1
- data/lib/potassium/assets/bin/cibuild.erb +0 -100
- data/lib/potassium/assets/docker-compose.ci.yml +0 -11
- data/lib/potassium/assets/sidekiq_scheduler.yml +0 -9
- data/lib/potassium/assets/testing/paperclip.rb +0 -59
- data/lib/potassium/recipes/active_storage.rb +0 -40
- data/lib/potassium/recipes/angular_admin.rb +0 -56
- data/lib/potassium/recipes/aws_sdk.rb +0 -7
- data/lib/potassium/recipes/paperclip.rb +0 -47
- data/spec/features/active_storage_spec.rb +0 -30
- data/spec/features/front_end.rb +0 -30
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7
|
data/CHANGELOG.md
CHANGED
@@ -2,12 +2,103 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 6.3.0
|
6
|
+
|
7
|
+
Features:
|
8
|
+
- Add `monitoring` recipe with scout gem [#353](https://github.com/platanus/potassium/pull/353)
|
9
|
+
- Change CircleCI config to use cache in tests, and remove old cibuild flow [#366](https://github.com/platanus/potassium/pull/366)
|
10
|
+
|
11
|
+
Fixes:
|
12
|
+
- Explicitly install project specified node version in CircleCI build [#352](https://github.com/platanus/potassium/pull/352)
|
13
|
+
- Fixes `tailwindCSS@^2` incompatibility with `postcss@^7` [#356](https://github.com/platanus/potassium/pull/356)
|
14
|
+
- Update marcel gem (shrine's mime type analyzer) to avoid mimemagic dependency [#357](https://github.com/platanus/potassium/pull/357)
|
15
|
+
- Explicitly set the frontend test environment to `jsdom` [#367](https://github.com/platanus/potassium/pull/367)
|
16
|
+
|
17
|
+
## 6.2.0
|
18
|
+
|
19
|
+
Features:
|
20
|
+
- Add Google Tag Manager [#326](https://github.com/platanus/potassium/pull/326)
|
21
|
+
- Update rubocop and rubocop-rspec for potassium and generated projects [#337](https://github.com/platanus/potassium/pull/337)
|
22
|
+
- Adds `mailers` queue to `sidekiq.yml` when installing or creating mailer recipe [#341](https://github.com/platanus/potassium/pull/341)
|
23
|
+
|
24
|
+
Fixes:
|
25
|
+
- Change `backgroud_processor` cli option to a switch. As of [#137](https://github.com/platanus/potassium/pull/137) we no longer have `delayed_jobs` as an option, it's only `sidekiq` now [#340](https://github.com/platanus/potassium/pull/340)
|
26
|
+
- Fixes mailer recipe install when background_processor wasn't installed [#341](https://github.com/platanus/potassium/pull/341)
|
27
|
+
- Update `heroku` recipe to check if an app or pipeline name is valid before creating it on Heroku [#344](https://github.com/platanus/potassium/pull/344)
|
28
|
+
|
29
|
+
## 6.1.0
|
30
|
+
|
31
|
+
Features:
|
32
|
+
- Check node version before project creation [#305](https://github.com/platanus/potassium/pull/305)
|
33
|
+
- Disable observers in test environment [#319](https://github.com/platanus/potassium/pull/319)
|
34
|
+
- Allow user to select custom Github repository [#318](https://github.com/platanus/potassium/pull/318)
|
35
|
+
- Add pull request template to github enabled projects [#320](https://github.com/platanus/potassium/pull/320)
|
36
|
+
- Use a Ruby gem instead of hub to create Github repositories [#323](https://github.com/platanus/potassium/pull/323)
|
37
|
+
- Add dockerized redis configuration when using background processor [#329](https://github.com/platanus/potassium/pull/329)
|
38
|
+
- Add beta support for GraphQL. [#330](https://github.com/platanus/potassium/pull/330)
|
39
|
+
- Add power_api [#301](https://github.com/platanus/potassium/pull/301)
|
40
|
+
|
41
|
+
|
42
|
+
Fix:
|
43
|
+
- Fix shrine issues related to configuration and uploader validation [#302](https://github.com/platanus/potassium/pull/302)
|
44
|
+
- Fix database recipe not running recommended generator for strong_migrations gem [#310](https://github.com/platanus/potassium/pull/310)
|
45
|
+
- Fix puma config that was causing it to crash on server start while on development [#313](https://github.com/platanus/potassium/pull/313)
|
46
|
+
- Fix purge css being enabled in development [#327](https://github.com/platanus/potassium/pull/327)
|
47
|
+
|
48
|
+
## 6.0.0
|
49
|
+
|
50
|
+
Features:
|
51
|
+
- Update ActiveAdmin to 2.6 [#246](https://github.com/platanus/potassium/pull/246)
|
52
|
+
- Update bundler to 2.0 [#250](https://github.com/platanus/potassium/pull/250)
|
53
|
+
- Update Rails to 6.0.2 [#251](https://github.com/platanus/potassium/pull/251)
|
54
|
+
- Improve specs performance [#259](https://github.com/platanus/potassium/pull/259)
|
55
|
+
- Dasherize app name in docker compose related files [#261](https://github.com/platanus/potassium/pull/261)
|
56
|
+
- Split specs by timings in CircleCI [#263](https://github.com/platanus/potassium/pull/263)
|
57
|
+
- Update ruby to 2.7.0 [#264](https://github.com/platanus/potassium/pull/264)
|
58
|
+
- Add tailwindcss [#266](https://github.com/platanus/potassium/pull/266)
|
59
|
+
- Update rack-cors to 1.1 [#269](https://github.com/platanus/potassium/pull/269)
|
60
|
+
- Use safer CORS configuration exposing only API and public resources [#271](https://github.com/platanus/potassium/pull/271)
|
61
|
+
- Add option to support Vue in ActiveAdmin [#272](https://github.com/platanus/potassium/pull/272)
|
62
|
+
- Add tests for Vue [#273](https://github.com/platanus/potassium/pull/278)
|
63
|
+
- Remove simple commands and docker-compose args in Makefile [#279](https://github.com/platanus/potassium/pull/279)
|
64
|
+
- Remove Paperclip and add [Shrine](https://github.com/shrinerb/shrine) for file_storage recipe [#291](https://github.com/platanus/potassium/pull/291)
|
65
|
+
- 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)
|
66
|
+
- Remove angular_admin recipe [#297](https://github.com/platanus/potassium/pull/297)
|
67
|
+
|
68
|
+
Fix:
|
69
|
+
- 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)
|
70
|
+
- Fix model auto annotate [#260](https://github.com/platanus/potassium/pull/260)
|
71
|
+
- Fix sidekiq repeated installation on potassium create if selecting mailer [#262](https://github.com/platanus/potassium/pull/262)
|
72
|
+
- Include ApiErrorConcern in all environments [#270](https://github.com/platanus/potassium/pull/270)
|
73
|
+
|
74
|
+
## 5.2.3
|
75
|
+
|
76
|
+
Features:
|
77
|
+
- Add restore-from commands for pg_restore in makefile [#237](https://github.com/platanus/potassium/pull/237)
|
78
|
+
- Allow usage of vue components in rails views out of the box [#231](https://github.com/platanus/potassium/pull/231)
|
79
|
+
- Add data migrate [#227](https://github.com/platanus/potassium/pull/227)
|
80
|
+
- Add raven capture in error handler if sentry enabled [#226](https://github.com/platanus/potassium/pull/226)
|
81
|
+
- Remove unnecesary aws-sdk gems in favor of specific ones [#221](https://github.com/platanus/potassium/pull/221)
|
82
|
+
- Unify storage options and deprecate paperclip [#211](https://github.com/platanus/potassium/pull/211)
|
83
|
+
|
84
|
+
Fix:
|
85
|
+
- Fix gather_gem issue when multiple versions passed as argument [#242](https://github.com/platanus/potassium/pull/242)
|
86
|
+
- Support "None" passed as CLI flag option in file storage [#240](https://github.com/platanus/potassium/pull/240)
|
87
|
+
- Add sidekiq worker to Procfile if installed after project setup (with heroku) [#234](https://github.com/platanus/potassium/pull/234)
|
88
|
+
- Include test_data volume to CI compose for bundler related data [#229](https://github.com/platanus/potassium/pull/229)
|
89
|
+
- Comment out schedule entry in sidekiq.yml [#225](https://github.com/platanus/potassium/pull/225)
|
90
|
+
- Use ruby image for potassium test build [#224](https://github.com/platanus/potassium/pull/224)
|
91
|
+
- Use webpacker from rubygems instead of repo master [#222](https://github.com/platanus/potassium/pull/222)
|
92
|
+
- Add rubocop-rspec for compatibility with updated linters in spec [#218](https://github.com/platanus/potassium/pull/218)
|
93
|
+
- Remove containers after spec run [#216](https://github.com/platanus/potassium/pull/216)
|
94
|
+
- Fix database container install [#214](https://github.com/platanus/potassium/pull/214)
|
95
|
+
|
5
96
|
## 5.2.2
|
6
97
|
|
7
98
|
Features:
|
8
99
|
- Implement release phase on heroku
|
9
100
|
- Add sendgrid_dev support
|
10
|
-
|
101
|
+
|
11
102
|
Fix:
|
12
103
|
- Fix Circle CI
|
13
104
|
- Fix services containers env variables
|
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
|
-
>
|
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,41 @@ 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
|
-
- [
|
40
|
-
- [
|
41
|
-
- [
|
42
|
-
- [
|
43
|
-
- [
|
44
|
-
- [
|
45
|
-
- [
|
46
|
-
- [
|
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
|
52
|
-
- [Faker](https://github.com/stympy/faker) for
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
- [
|
58
|
-
- [
|
59
|
-
- [
|
60
|
-
- [
|
61
|
-
- [
|
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
|
+
- [Scout](https://github.com/scoutapp/scout_apm_ruby) for monitoring performance
|
56
|
+
|
57
|
+
The following optional integrations are also added:
|
58
|
+
|
59
|
+
- [PostgreSQL](http://www.postgresql.org) or [MySQL](https://www.mysql.com) for the database
|
60
|
+
- [Devise](https://github.com/plataformatec/devise) for authentication
|
61
|
+
- [ActiveAdmin](http://activeadmin.info) for admin interfaces
|
62
|
+
- [ActiveAdminAddons](https://github.com/platanus/activeadmin_addons) for some help with ActiveAdmin
|
63
|
+
- [Pundit](https://github.com/elabs/pundit) for role-based authorization
|
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
|
+
- [Google Tag Manager](https://tagmanager.google.com/) for analytics
|
71
|
+
- Creates the Github repository of your choice for the project. A local git repository will always be created.
|
68
72
|
|
69
73
|
A few more things are added to the project:
|
70
74
|
|
71
75
|
- 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)
|
76
|
+
- Setup continuous integration in [CircleCI](circle-ci) to run tests
|
74
77
|
- A `bin/setup` script to setup things on a newly cloned project
|
75
78
|
- A `bin/cibuild` script to run continuous integration build on CI
|
76
79
|
- A `db:fake_data:load` rake task to load fake data for development
|
@@ -81,24 +84,20 @@ A few more things are added to the project:
|
|
81
84
|
|
82
85
|
The optional API support includes:
|
83
86
|
|
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
|
87
|
+
- [Responders](https://github.com/plataformatec/responders) for dry-ing our api controllers
|
88
|
+
- [Versionist](https://github.com/bploetz/versionist) for some flexible api versioning
|
89
|
+
- [ActiveModel::Serializers](https://github.com/rails-api/active_model_serializers) for record serialization
|
90
|
+
- [Simple Token Authentication](https://github.com/gonzalo-bulnes/simple_token_authentication) for stateless API authentication
|
88
91
|
|
89
92
|
### Heroku
|
90
93
|
|
91
94
|
When you choose to deploy to heroku a few extra things are added for the project.
|
92
95
|
|
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.
|
96
|
+
- 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
97
|
- Adds a [Procfile][procfile] to define the processes to run in heroku
|
97
|
-
- Setup continuous integration using docker and herokuish to maintain better
|
98
|
-
|
99
|
-
- Adds a `.buildpacks` file with the default buildpacks to use. It use the
|
100
|
-
following buildpacks:
|
101
|
-
- 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`.
|
98
|
+
- Setup continuous integration using docker and herokuish to maintain better parity between testing and production environments
|
99
|
+
- 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`
|
100
|
+
- Adds a `.buildpacks` file with the default buildpacks to use. It use the following buildpacks:
|
102
101
|
|
103
102
|
| index | buildpack | description |
|
104
103
|
|-------|-----------|-------------|
|
@@ -110,7 +109,7 @@ Also the heroku applications are created
|
|
110
109
|
|
111
110
|
- Creates a `staging` and `production` applications
|
112
111
|
- Creates a pipeline and assign the above application to the `staging`
|
113
|
-
and `production` stages
|
112
|
+
and `production` stages
|
114
113
|
- Setup initial configuration variables
|
115
114
|
- Set the application buildpack to the [multi-buildpack][heroku-buildpack-multi]
|
116
115
|
|
@@ -126,11 +125,9 @@ In order to CicleCI start building the project on each push you need tell circle
|
|
126
125
|
Go to https://circleci.com/add-projects, choose the repository from the list and hit
|
127
126
|
**Build Project**
|
128
127
|
|
129
|
-
|
128
|
+
#### ReviewDog
|
130
129
|
|
131
|
-
In order to
|
132
|
-
Go to https://monkeyci.platan.us, choose the repository from the list and hit
|
133
|
-
**Activate**
|
130
|
+
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.
|
134
131
|
|
135
132
|
[logging-gem]: https://github.com/heroku/rails_stdout_logging
|
136
133
|
[heroku-logging]: https://devcenter.heroku.com/articles/logging#writing-to-your-log
|
@@ -149,15 +146,24 @@ This is useful when you are adding new recipes to Potassium, and you want to use
|
|
149
146
|
To achieve this you need to run, **In the Potassium's root path**, the `bin/potassium_test create` instead of `potassium create` command.
|
150
147
|
This command, will do the same as `potassium create` but first:
|
151
148
|
|
152
|
-
- Will drop any existent database of the test app
|
153
|
-
- Will remove the directory containing a previous version of the test app
|
149
|
+
- Will drop any existent database of the test app
|
150
|
+
- Will remove the directory containing a previous version of the test app
|
154
151
|
|
155
152
|
It's important to remember that `bin/potassium_test create`:
|
156
153
|
|
157
154
|
- Does not receive an `app_path` param. It always creates the test project inside `/tmp/dummy_app`
|
158
|
-
- Can receive the same options as `potassium create
|
155
|
+
- Can receive the same options as `potassium create`
|
159
156
|
- 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`
|
160
157
|
|
158
|
+
## Publishing
|
159
|
+
On master branch.
|
160
|
+
|
161
|
+
1. Change `VERSION` in `lib/potassium/version.rb`
|
162
|
+
2. Change `Unreleased` title to current version in `CHANGELOG.md`
|
163
|
+
3. Commit new release. For example: `Releasing v6.3.0`
|
164
|
+
4. Create tag. For example: `git tag v6.3.0`
|
165
|
+
5. Push tag: `git push origin v6.3.0`
|
166
|
+
|
161
167
|
## Contributing
|
162
168
|
|
163
169
|
If you want to add functionality please go to
|
@@ -173,4 +179,4 @@ potassium is maintained by [platanus](http://platan.us).
|
|
173
179
|
|
174
180
|
## License
|
175
181
|
|
176
|
-
Potassium is © 2014
|
182
|
+
Potassium is © 2014 Platanus, SPA. It is free software and may be redistributed under the terms specified in the LICENSE file.
|
data/docs/DSL.md
CHANGED
@@ -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.
|
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
|
-
|
320
|
-
title: "
|
321
|
-
body: "
|
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, :
|
325
|
+
add_readme_section(:internal_dependencies, :devise)
|
326
326
|
```
|
@@ -0,0 +1,151 @@
|
|
1
|
+
version: 2.1
|
2
|
+
|
3
|
+
ruby-image: &ruby-image circleci/ruby:<%= ruby_version %>
|
4
|
+
<%- if selected?(:database, :postgresql) -%>
|
5
|
+
postgres-image: &postgres-image postgres:<%= Potassium::POSTGRES_VERSION %>
|
6
|
+
<%- end -%>
|
7
|
+
<%- if selected?(:background_processor) -%>
|
8
|
+
redis-image: &redis-image redis
|
9
|
+
<%- end -%>
|
10
|
+
env-vars: &env-vars
|
11
|
+
BUNDLE_JOBS: 4
|
12
|
+
BUNDLE_PATH: vendor/bundle
|
13
|
+
RAILS_ENV: test
|
14
|
+
|
15
|
+
executors:
|
16
|
+
test-executor:
|
17
|
+
docker:
|
18
|
+
- image: *ruby-image
|
19
|
+
environment: *env-vars
|
20
|
+
<%- if selected?(:database, :postgresql) -%>
|
21
|
+
- image: *postgres-image
|
22
|
+
<%- end -%>
|
23
|
+
<%- if selected?(:background_processor) -%>
|
24
|
+
- image: *redis-image
|
25
|
+
<%- end -%>
|
26
|
+
|
27
|
+
lint-executor:
|
28
|
+
docker:
|
29
|
+
- image: *ruby-image
|
30
|
+
environment: *env-vars
|
31
|
+
|
32
|
+
commands:
|
33
|
+
setup:
|
34
|
+
description: checkout code, restore cache, install dependencies, save cache
|
35
|
+
steps:
|
36
|
+
- checkout
|
37
|
+
|
38
|
+
- restore_cache:
|
39
|
+
keys:
|
40
|
+
- bundle-dependencies-{{ checksum "Gemfile.lock" }}
|
41
|
+
- bundle-dependencies-
|
42
|
+
|
43
|
+
- restore_cache:
|
44
|
+
keys:
|
45
|
+
- yarn-dependencies-{{ checksum "yarn.lock" }}
|
46
|
+
- yarn-dependencies-
|
47
|
+
|
48
|
+
- run:
|
49
|
+
name: Install bundle dependencies
|
50
|
+
command: |
|
51
|
+
BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")
|
52
|
+
gem install bundler:$BUNDLER_VERSION
|
53
|
+
bundle _$(echo $BUNDLER_VERSION)_ install
|
54
|
+
|
55
|
+
- run:
|
56
|
+
name: Install yarn dependencies
|
57
|
+
command: |
|
58
|
+
curl -sL https://deb.nodesource.com/setup_$(cat .node-version).x | sudo -E bash -
|
59
|
+
sudo apt-get install -y nodejs
|
60
|
+
curl -o- -sL https://yarnpkg.com/install.sh | bash
|
61
|
+
sudo ln -s $HOME/.yarn/bin/yarn /usr/local/bin/yarn
|
62
|
+
yarn install --frozen-lockfile
|
63
|
+
|
64
|
+
- save_cache:
|
65
|
+
key: bundle-dependencies-{{ checksum "Gemfile.lock" }}
|
66
|
+
paths:
|
67
|
+
- vendor/bundle
|
68
|
+
|
69
|
+
- save_cache:
|
70
|
+
key: yarn-dependencies-{{ checksum "yarn.lock" }}
|
71
|
+
paths:
|
72
|
+
- node_modules
|
73
|
+
|
74
|
+
jobs:
|
75
|
+
test:
|
76
|
+
executor: test-executor
|
77
|
+
steps:
|
78
|
+
- setup
|
79
|
+
|
80
|
+
<%- if selected?(:background_processor) -%>
|
81
|
+
- run:
|
82
|
+
name: Wait for redis service
|
83
|
+
command: dockerize -wait tcp://localhost:6379 -timeout 1m
|
84
|
+
<%- end -%>
|
85
|
+
<%- if selected?(:database, :postgresql) -%>
|
86
|
+
- run:
|
87
|
+
name: Wait for postgres service
|
88
|
+
command: dockerize -wait tcp://localhost:5432 -timeout 1m
|
89
|
+
|
90
|
+
- run:
|
91
|
+
name: Setup database
|
92
|
+
command: bundle exec rails db:create db:schema:load
|
93
|
+
<%- end -%>
|
94
|
+
|
95
|
+
- run:
|
96
|
+
name: Run rspec
|
97
|
+
command: |
|
98
|
+
RSPEC_JUNIT_ARGS="-r rspec_junit_formatter -f RspecJunitFormatter -o test_results/rspec.xml"
|
99
|
+
RSPEC_FORMAT_ARGS="-f progress --no-color -p 10"
|
100
|
+
bundle exec rspec spec $RSPEC_FORMAT_ARGS $RSPEC_JUNIT_ARGS
|
101
|
+
|
102
|
+
<%- if selected?(:front_end, :vue) -%>
|
103
|
+
- run:
|
104
|
+
name: Run jest
|
105
|
+
command: yarn run test
|
106
|
+
<%- end -%>
|
107
|
+
|
108
|
+
- store_test_results:
|
109
|
+
path: test_results
|
110
|
+
|
111
|
+
lint:
|
112
|
+
executor: lint-executor
|
113
|
+
steps:
|
114
|
+
- setup
|
115
|
+
|
116
|
+
- run:
|
117
|
+
name: Install reviewdog
|
118
|
+
command: |
|
119
|
+
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b ./bin
|
120
|
+
|
121
|
+
- run:
|
122
|
+
name: Get files to lint
|
123
|
+
command: git diff origin/master --name-only --diff-filter=d > tmp/files_to_lint
|
124
|
+
|
125
|
+
- run:
|
126
|
+
name: Run rubocop
|
127
|
+
shell: /bin/bash
|
128
|
+
command: |
|
129
|
+
cat tmp/files_to_lint | grep -E '.+\.(rb)$' | xargs bundle exec rubocop --force-exclusion \
|
130
|
+
| ./bin/reviewdog -reporter=github-pr-review -f=rubocop
|
131
|
+
|
132
|
+
- run:
|
133
|
+
name: Run eslint
|
134
|
+
shell: /bin/bash
|
135
|
+
command: |
|
136
|
+
cat tmp/files_to_lint | grep -E '.+\.(js|jsx|vue)$' | xargs yarn run eslint \
|
137
|
+
| ./bin/reviewdog -reporter=github-pr-review -f=eslint
|
138
|
+
|
139
|
+
- run:
|
140
|
+
name: Run stylelint
|
141
|
+
shell: /bin/bash
|
142
|
+
command: |
|
143
|
+
cat tmp/files_to_lint | grep -E '.+\.(scss|css|less)$' | xargs yarn run stylelint \
|
144
|
+
| ./bin/reviewdog -reporter=github-pr-review -f=stylelint
|
145
|
+
|
146
|
+
workflows:
|
147
|
+
test_and_lint:
|
148
|
+
jobs:
|
149
|
+
- test
|
150
|
+
- lint:
|
151
|
+
context: org-global
|