Skip to content

Instantly share code, notes, and snippets.

@smapira
Last active January 16, 2022 07:03
Show Gist options
  • Save smapira/cc6a50f82cea034b07f02088c06b65dd to your computer and use it in GitHub Desktop.
Save smapira/cc6a50f82cea034b07f02088c06b65dd to your computer and use it in GitHub Desktop.

Revisions

  1. smapira revised this gist Jan 16, 2022. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions Makefile into Rails
    Original file line number Diff line number Diff line change
    @@ -108,6 +108,9 @@ install-bullet:
    install-rack-profiler:
    bundle exec rails generate rack_profiler:install

    install-delayed-job:
    bundle exec rails generate delayed_job:active_record

    ## ==============================
    ## executions
    ## ==============================
  2. smapira revised this gist Jan 16, 2022. 1 changed file with 5 additions and 8 deletions.
    13 changes: 5 additions & 8 deletions Makefile into Rails
    Original file line number Diff line number Diff line change
    @@ -97,19 +97,16 @@ install-bundle:
    bundle install --path vendor/bundle --jobs 4

    install-spec:
    bundle exec rails g rspec:install
    bundle exec rails generate rspec:install

    install-annotate:
    bundle exe rails generate annotate:install

    install-bullet:
    bundle exec rails g bullet:install

    install-annotate:
    bundle exec rails g annotate:install
    bundle exec rails generate bullet:install

    install-rack-profiler:
    bundle exec rails g rack_profiler:install
    bundle exec rails generate rack_profiler:install

    ## ==============================
    ## executions
    @@ -170,8 +167,8 @@ describe-annotate:
    audit-practices:
    bundle exec rails_best_practices app/.

    audit-schema
    bundle exec database_consistency
    audit-schema:
    bundle exec database_consistency

    read-bullet-log:
    tail -f log/bullet.log
  3. smapira revised this gist Jan 16, 2022. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions Makefile into Rails
    Original file line number Diff line number Diff line change
    @@ -112,7 +112,7 @@ install-rack-profiler:
    bundle exec rails g rack_profiler:install

    ## ==============================
    ## processes
    ## executions
    ## ==============================

    lint:
    @@ -170,10 +170,12 @@ describe-annotate:
    audit-practices:
    bundle exec rails_best_practices app/.

    audit-schema
    bundle exec database_consistency

    read-bullet-log:
    tail -f log/bullet.log


    ## ==============================
    ## aliases
    ## ==============================
  4. smapira revised this gist Jan 16, 2022. 1 changed file with 54 additions and 49 deletions.
    103 changes: 54 additions & 49 deletions Makefile into Rails
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,17 @@
    # curl https://gist.github.com/smapira/cc6a50f82cea034b07f02088c06b65dd/raw --output Makefile

    ## ==============================
    ## database organizations
    ## ==============================

    drop-db:
    bundle exec rails db:environment:set RAILS_ENV=development && bundle exec rake db:drop

    create-db:
    bundle exec rake db:create

    migrate-db:
    bundle exec rake db:migrate
    bundle exec rake db:migrate_custom

    import-seed:
    bundle exec rake db:seed
    @@ -19,7 +23,7 @@ create-db-spring:
    bundle exec spring rake db:create

    migrate-db-spring:
    bundle exec spring rake db:migrate
    bundle exec spring rake db:migrate_custom

    import-seed-spring:
    bundle exec spring rake db:seed
    @@ -34,7 +38,7 @@ create-db-production:
    RAILS_ENV=production bundle exec rake db:create

    migrate-db-production:
    RAILS_ENV=production bundle exec rake db:migrate
    RAILS_ENV=production bundle exec rake db:migrate_custom

    import-seed-production:
    RAILS_ENV=production bundle exec rake db:seed
    @@ -55,7 +59,7 @@ create-db-test-spring:
    RAILS_ENV=test bundle exec spring rake db:create

    migrate-db-test:
    RAILS_ENV=test bundle exec rake db:migrate
    RAILS_ENV=test bundle exec rake db:migrate_custom

    dump-seed:
    bundle exec rake db:seed:dump
    @@ -64,16 +68,20 @@ import-seed-test:
    RAILS_ENV=test bundle exec rake db:seed

    migrate-db-test-spring:
    RAILS_ENV=test bundle exec spring rake db:migrate
    RAILS_ENV=test bundle exec spring rake db:migrate_custom

    import-seed-test-spring:
    RAILS_ENV=test bundle exec spring rake db:seed

    ## ==============================
    ## installations
    ## ==============================

    fetch-rubocop:
    curl https://gist.github.com/smapira/d07bd6464241cc559bef1548895b9af0/raw --output .rubocop.yml

    fetch-makefile:
    curl https://gist.github.com/smapira/cc6a50f82cea034b07f02088c06b65dd/raw --output Makefile
    curl https://gist.github.com/gambala/4874e2b41a52ac043a274a61f5d7726b --output Makefile

    fetch-gemfile:
    curl https://gist.github.com/smapira/2dbc861e4212a2f86c3e0d09a7c6de27/raw --output Gemfile
    @@ -85,36 +93,36 @@ fetch-ci:
    mkdir .circleci
    curl https://gist.github.com/smapira/b95f4cce9a78e9e256d2cb58f8c44084/raw --output .circleci/config.yml

    fetch-pry:
    curl https://gist.github.com/smapira/80b890029fbe08ddeacd4ada6f338a83/raw --output .pryrc

    install-gems:
    install-bundle:
    bundle install --path vendor/bundle --jobs 4

    install-kss:
    bundle exec rails generate kss:install
    install-spec:
    bundle exec rails g rspec:install

    install-kaminari:
    bundle exec rails generate kaminari:config
    install-annotate:
    bundle exe rails generate annotate:install

    install-rbs:
    bundle exec rails rbs_rails:all
    install-bullet:
    bundle exec rails g bullet:install

    install-annotate:
    bundle exec rails g annotate:install

    install-rack-profiler:
    bundle exec rails g rack_profiler:install

    ## ==============================
    ## processes
    ## ==============================

    lint:
    bundle exec rubocop -a -c .rubocop.yml
    bundle exec rubocop -A -c .rubocop.yml

    lint-spring:
    bundle exec spring rubocop -a -c .rubocop.yml

    security:
    bundle exec brakeman
    bundle exec spring rubocop -A -c .rubocop.yml

    mailcatcher:
    bundle exec mailcatcher
    open http://localhost:1080/

    install-spec:
    bundle exec rails g rspec:install
    bundle exec mailcatcher && open http://localhost:1080/

    run-console:
    bundle exec rails console
    @@ -134,15 +142,6 @@ run-spring:
    terminate-spring:
    ./bin/spring stop

    describe-route:
    bundle exec annotate --routes

    describe-annotate:
    bundle exec annotate --delete && bundle exec annotate

    configure-annotate:
    bundle exe rails generate annotate:install

    convert-html-slim:
    bundle exec html2slim app/views

    @@ -152,26 +151,32 @@ convert-erb-slim:
    open-letter-opener:
    open http://0.0.0.0:3000/letter_opener

    rails-best-practices:
    bundle exec rails_best_practices app/.
    factory-model:
    bundle exec rails g factory_bot:model Car name speed:integer

    install-bullet:
    bundle exec rails g bullet:install
    ## ==============================
    ## audits
    ## ==============================

    install-annotate:
    bundle exec rails g annotate:install
    audit-security:
    bundle exec brakeman

    describe-route:
    bundle exec annotate --routes

    describe-annotate:
    bundle exec annotate --delete && bundle exec annotate

    audit-practices:
    bundle exec rails_best_practices app/.

    read-bullet-log:
    tail -f log/bullet.log

    install-rack-profiler:
    bundle exec rails g rack_profiler:install

    factory-model:
    bundle exec rails g factory_bot:model Car name speed:integer

    shutdown:
    kill -9 $(cat $PWD/tmp/pids/server.pid)
    ## ==============================
    ## aliases
    ## ==============================

    db-test: drop-db-test create-db-test migrate-db-test import-seed-test

    @@ -185,6 +190,6 @@ s: run-server

    m: drop-db create-db migrate-db import-seed lint db-test

    ms: drop-db-spring create-db-spring migrate-db-spring import-seed-spring lint-spring db-test-spring
    ms: drop-db-spring create-db-spring migrate-db-spring import-seed-spring db-test-spring

    mp: drop-db-production create-db-production migrate-db-production import-seed-production
  5. smapira revised this gist Sep 23, 2021. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions Makefile into Rails
    Original file line number Diff line number Diff line change
    @@ -72,9 +72,6 @@ import-seed-test-spring:
    fetch-rubocop:
    curl https://gist.github.com/smapira/d07bd6464241cc559bef1548895b9af0/raw --output .rubocop.yml

    fetch-rubocop:
    curl https://gist.github.com/smapira/d07bd6464241cc559bef1548895b9af0/raw --output .rubocop.yml

    fetch-makefile:
    curl https://gist.github.com/smapira/cc6a50f82cea034b07f02088c06b65dd/raw --output Makefile

  6. smapira renamed this gist Sep 20, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  7. smapira revised this gist Sep 20, 2021. 1 changed file with 16 additions and 1 deletion.
    17 changes: 16 additions & 1 deletion Makefile
    Original file line number Diff line number Diff line change
    @@ -72,6 +72,9 @@ import-seed-test-spring:
    fetch-rubocop:
    curl https://gist.github.com/smapira/d07bd6464241cc559bef1548895b9af0/raw --output .rubocop.yml

    fetch-rubocop:
    curl https://gist.github.com/smapira/d07bd6464241cc559bef1548895b9af0/raw --output .rubocop.yml

    fetch-makefile:
    curl https://gist.github.com/smapira/cc6a50f82cea034b07f02088c06b65dd/raw --output Makefile

    @@ -85,9 +88,21 @@ fetch-ci:
    mkdir .circleci
    curl https://gist.github.com/smapira/b95f4cce9a78e9e256d2cb58f8c44084/raw --output .circleci/config.yml

    install-bundle:
    fetch-pry:
    curl https://gist.github.com/smapira/80b890029fbe08ddeacd4ada6f338a83/raw --output .pryrc

    install-gems:
    bundle install --path vendor/bundle --jobs 4

    install-kss:
    bundle exec rails generate kss:install

    install-kaminari:
    bundle exec rails generate kaminari:config

    install-rbs:
    bundle exec rails rbs_rails:all

    lint:
    bundle exec rubocop -a -c .rubocop.yml

  8. smapira revised this gist Aug 28, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Makefile
    Original file line number Diff line number Diff line change
    @@ -73,7 +73,7 @@ fetch-rubocop:
    curl https://gist.github.com/smapira/d07bd6464241cc559bef1548895b9af0/raw --output .rubocop.yml

    fetch-makefile:
    curl https://gist.github.com/gambala/4874e2b41a52ac043a274a61f5d7726b --output Makefile
    curl https://gist.github.com/smapira/cc6a50f82cea034b07f02088c06b65dd/raw --output Makefile

    fetch-gemfile:
    curl https://gist.github.com/smapira/2dbc861e4212a2f86c3e0d09a7c6de27/raw --output Gemfile
  9. smapira revised this gist Jun 3, 2021. 1 changed file with 13 additions and 4 deletions.
    17 changes: 13 additions & 4 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # curl https://gist.github.com/smapira/cc6a50f82cea034b07f02088c06b65dd/raw --output Makefile

    drop-db:
    bundle exec rake db:drop
    bundle exec rails db:environment:set RAILS_ENV=development && bundle exec rake db:drop

    create-db:
    bundle exec rake db:create
    @@ -13,7 +13,7 @@ import-seed:
    bundle exec rake db:seed

    drop-db-spring:
    bundle exec spring rake db:drop
    bundle exec rails db:environment:set RAILS_ENV=development && bundle exec spring rake db:drop

    create-db-spring:
    bundle exec spring rake db:create
    @@ -24,6 +24,9 @@ migrate-db-spring:
    import-seed-spring:
    bundle exec spring rake db:seed

    import-seed-ken-all:
    bundle exec rake ken_all:import:silent

    drop-db-production:
    RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:drop

    @@ -36,6 +39,9 @@ migrate-db-production:
    import-seed-production:
    RAILS_ENV=production bundle exec rake db:seed

    import-seed-ken-all-production:
    RAILS_ENV=production bundle exec rake ken_all:import:silent

    drop-db-test:
    RAILS_ENV=test bundle exec rake db:drop

    @@ -52,7 +58,7 @@ migrate-db-test:
    RAILS_ENV=test bundle exec rake db:migrate

    dump-seed:
    bundle exec rake db:seed:dump MODELS=WorkingStyle FILE=db/seeds/worknig_style.rb
    bundle exec rake db:seed:dump

    import-seed-test:
    RAILS_ENV=test bundle exec rake db:seed
    @@ -120,7 +126,7 @@ describe-route:
    bundle exec annotate --routes

    describe-annotate:
    bundle exec annotate
    bundle exec annotate --delete && bundle exec annotate

    configure-annotate:
    bundle exe rails generate annotate:install
    @@ -140,6 +146,9 @@ rails-best-practices:
    install-bullet:
    bundle exec rails g bullet:install

    install-annotate:
    bundle exec rails g annotate:install

    read-bullet-log:
    tail -f log/bullet.log

  10. smapira revised this gist May 7, 2021. 1 changed file with 0 additions and 17 deletions.
    17 changes: 0 additions & 17 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -7,10 +7,6 @@ create-db:
    bundle exec rake db:create

    migrate-db:
    rm -fr db/migrate/*
    ./scripts/gem/ken-all.sh
    bundle exec rake hitoetsunagi_entity_engine:install:migrations
    bundle exec rails g delayed_job:active_record
    bundle exec rake db:migrate

    import-seed:
    @@ -23,10 +19,6 @@ create-db-spring:
    bundle exec spring rake db:create

    migrate-db-spring:
    rm -fr db/migrate/*
    ./scripts/gem/ken-all.sh
    bundle exec spring rake hitoetsunagi_entity_engine:install:migrations
    bundle exec rails g delayed_job:active_record
    bundle exec spring rake db:migrate

    import-seed-spring:
    @@ -39,12 +31,9 @@ create-db-production:
    RAILS_ENV=production bundle exec rake db:create

    migrate-db-production:
    RAILS_ENV=production bundle exec rake hitoetsunagi_entity_engine:install:migrations
    RAILS_ENV=production bundle exec rake ken_all:install:migrations
    RAILS_ENV=production bundle exec rake db:migrate

    import-seed-production:
    RAILS_ENV=production bundle exec rake ken_all:import:silent
    RAILS_ENV=production bundle exec rake db:seed

    drop-db-test:
    @@ -60,24 +49,18 @@ create-db-test-spring:
    RAILS_ENV=test bundle exec spring rake db:create

    migrate-db-test:
    RAILS_ENV=test bundle exec rake hitoetsunagi_entity_engine:install:migrations
    RAILS_ENV=test bundle exec rake ken_all:install:migrations
    RAILS_ENV=test bundle exec rake db:migrate

    dump-seed:
    bundle exec rake db:seed:dump MODELS=WorkingStyle FILE=db/seeds/worknig_style.rb

    import-seed-test:
    RAILS_ENV=test bundle exec rake ken_all:import:silent
    RAILS_ENV=test bundle exec rake db:seed

    migrate-db-test-spring:
    RAILS_ENV=test bundle exec spring rake hitoetsunagi_entity_engine:install:migrations
    RAILS_ENV=test bundle exec spring rake ken_all:install:migrations
    RAILS_ENV=test bundle exec spring rake db:migrate

    import-seed-test-spring:
    RAILS_ENV=test bundle exec rake ken_all:import:silent
    RAILS_ENV=test bundle exec spring rake db:seed

    fetch-rubocop:
  11. smapira revised this gist Mar 10, 2021. 1 changed file with 53 additions and 4 deletions.
    57 changes: 53 additions & 4 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,10 @@ create-db:
    bundle exec rake db:create

    migrate-db:
    rm -fr db/migrate/*
    ./scripts/gem/ken-all.sh
    bundle exec rake hitoetsunagi_entity_engine:install:migrations
    bundle exec rails g delayed_job:active_record
    bundle exec rake db:migrate

    import-seed:
    @@ -19,6 +23,10 @@ create-db-spring:
    bundle exec spring rake db:create

    migrate-db-spring:
    rm -fr db/migrate/*
    ./scripts/gem/ken-all.sh
    bundle exec spring rake hitoetsunagi_entity_engine:install:migrations
    bundle exec rails g delayed_job:active_record
    bundle exec spring rake db:migrate

    import-seed-spring:
    @@ -31,9 +39,12 @@ create-db-production:
    RAILS_ENV=production bundle exec rake db:create

    migrate-db-production:
    RAILS_ENV=production bundle exec rake hitoetsunagi_entity_engine:install:migrations
    RAILS_ENV=production bundle exec rake ken_all:install:migrations
    RAILS_ENV=production bundle exec rake db:migrate

    seed-db-production:
    import-seed-production:
    RAILS_ENV=production bundle exec rake ken_all:import:silent
    RAILS_ENV=production bundle exec rake db:seed

    drop-db-test:
    @@ -42,16 +53,31 @@ drop-db-test:
    create-db-test:
    RAILS_ENV=test bundle exec rake db:create

    drop-db-test-spring:
    RAILS_ENV=test bundle exec spring rake db:drop

    create-db-test-spring:
    RAILS_ENV=test bundle exec spring rake db:create

    migrate-db-test:
    RAILS_ENV=test bundle exec rake hitoetsunagi_entity_engine:install:migrations
    RAILS_ENV=test bundle exec rake ken_all:install:migrations
    RAILS_ENV=test bundle exec rake db:migrate

    dump-seed:
    bundle exec rake db:seed:dump MODELS=WorkingStyle FILE=db/seeds/worknig_style.rb

    import-seed-test:
    RAILS_ENV=test bundle exec rake ken_all:import:silent
    RAILS_ENV=test bundle exec rake db:seed

    migrate-db-test-spring:
    RAILS_ENV=test bundle exec spring rake hitoetsunagi_entity_engine:install:migrations
    RAILS_ENV=test bundle exec spring rake ken_all:install:migrations
    RAILS_ENV=test bundle exec spring rake db:migrate

    import-seed-test-spring:
    RAILS_ENV=test bundle exec rake ken_all:import:silent
    RAILS_ENV=test bundle exec spring rake db:seed

    fetch-rubocop:
    @@ -107,10 +133,10 @@ run-spring:
    terminate-spring:
    ./bin/spring stop

    describe-routes:
    describe-route:
    bundle exec annotate --routes

    describe-annotates:
    describe-annotate:
    bundle exec annotate

    configure-annotate:
    @@ -122,9 +148,30 @@ convert-html-slim:
    convert-erb-slim:
    bundle exec erb2slim app/views

    open-letter-opener:
    open http://0.0.0.0:3000/letter_opener

    rails-best-practices:
    bundle exec rails_best_practices app/.

    install-bullet:
    bundle exec rails g bullet:install

    read-bullet-log:
    tail -f log/bullet.log

    install-rack-profiler:
    bundle exec rails g rack_profiler:install

    factory-model:
    bundle exec rails g factory_bot:model Car name speed:integer

    shutdown:
    kill -9 $(cat $PWD/tmp/pids/server.pid)

    db-test: drop-db-test create-db-test migrate-db-test import-seed-test

    db-test-spring: migrate-db-test-spring import-seed-test-spring
    db-test-spring: drop-db-test-spring create-db-test-spring migrate-db-test-spring import-seed-test-spring

    configure: fetch-rubocop fetch-makefile fetch-gemfile fetch-ignore fetch-ci install-bundle configure-annotate

    @@ -135,3 +182,5 @@ s: run-server
    m: drop-db create-db migrate-db import-seed lint db-test

    ms: drop-db-spring create-db-spring migrate-db-spring import-seed-spring lint-spring db-test-spring

    mp: drop-db-production create-db-production migrate-db-production import-seed-production
  12. smapira revised this gist Aug 22, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Makefile
    Original file line number Diff line number Diff line change
    @@ -126,7 +126,7 @@ db-test: drop-db-test create-db-test migrate-db-test import-seed-test

    db-test-spring: migrate-db-test-spring import-seed-test-spring

    configure: fetch-rubocop fetch-makefile fetch-gemfile fetch-ignore fetch-ci install-bundle
    configure: fetch-rubocop fetch-makefile fetch-gemfile fetch-ignore fetch-ci install-bundle configure-annotate

    c: run-console

  13. smapira revised this gist Aug 22, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Makefile
    Original file line number Diff line number Diff line change
    @@ -114,7 +114,7 @@ describe-annotates:
    bundle exec annotate

    configure-annotate:
    bundle exe rails genarate annotate:install
    bundle exe rails generate annotate:install

    convert-html-slim:
    bundle exec html2slim app/views
  14. smapira revised this gist Aug 22, 2020. 1 changed file with 15 additions and 0 deletions.
    15 changes: 15 additions & 0 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -107,6 +107,21 @@ run-spring:
    terminate-spring:
    ./bin/spring stop

    describe-routes:
    bundle exec annotate --routes

    describe-annotates:
    bundle exec annotate

    configure-annotate:
    bundle exe rails genarate annotate:install

    convert-html-slim:
    bundle exec html2slim app/views

    convert-erb-slim:
    bundle exec erb2slim app/views

    db-test: drop-db-test create-db-test migrate-db-test import-seed-test

    db-test-spring: migrate-db-test-spring import-seed-test-spring
  15. smapira revised this gist Aug 22, 2020. 1 changed file with 56 additions and 17 deletions.
    73 changes: 56 additions & 17 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -1,42 +1,58 @@
    # curl https://gist.github.com/smapira/cc6a50f82cea034b07f02088c06b65dd/raw --output Makefile

    db-drop:
    drop-db:
    bundle exec rake db:drop

    db-create:
    create-db:
    bundle exec rake db:create

    db-migrate:
    migrate-db:
    bundle exec rake db:migrate

    db-seed:
    import-seed:
    bundle exec rake db:seed

    db-drop-production:
    drop-db-spring:
    bundle exec spring rake db:drop

    create-db-spring:
    bundle exec spring rake db:create

    migrate-db-spring:
    bundle exec spring rake db:migrate

    import-seed-spring:
    bundle exec spring rake db:seed

    drop-db-production:
    RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:drop

    db-create-production:
    create-db-production:
    RAILS_ENV=production bundle exec rake db:create

    db-migrate-production:
    migrate-db-production:
    RAILS_ENV=production bundle exec rake db:migrate

    db-seed-production:
    seed-db-production:
    RAILS_ENV=production bundle exec rake db:seed

    db-drop-test:
    drop-db-test:
    RAILS_ENV=test bundle exec rake db:drop

    db-create-test:
    create-db-test:
    RAILS_ENV=test bundle exec rake db:create

    db-migrate-test:
    migrate-db-test:
    RAILS_ENV=test bundle exec rake db:migrate

    db-seed-test:
    import-seed-test:
    RAILS_ENV=test bundle exec rake db:seed

    db-test: db-drop-test db-create-test db-migrate-test db-seed-test
    migrate-db-test-spring:
    RAILS_ENV=test bundle exec spring rake db:migrate

    import-seed-test-spring:
    RAILS_ENV=test bundle exec spring rake db:seed

    fetch-rubocop:
    curl https://gist.github.com/smapira/d07bd6464241cc559bef1548895b9af0/raw --output .rubocop.yml
    @@ -54,15 +70,25 @@ fetch-ci:
    mkdir .circleci
    curl https://gist.github.com/smapira/b95f4cce9a78e9e256d2cb58f8c44084/raw --output .circleci/config.yml

    bundle-install:
    install-bundle:
    bundle install --path vendor/bundle --jobs 4

    lint:
    bundle exec rubocop -a -c .rubocop.yml

    lint-spring:
    bundle exec spring rubocop -a -c .rubocop.yml

    security:
    bundle exec brakeman

    mailcatcher:
    bundle exec mailcatcher
    open http://localhost:1080/

    install-spec:
    bundle exec rails g rspec:install

    run-console:
    bundle exec rails console

    @@ -72,12 +98,25 @@ run-server:
    terminate-server:
    kill -9 $(cat tmp/pids/server.pid)

    configure: fetch-rubocop fetch-makefile fetch-gemfile fetch-ignore fetch-ci bundle-install
    run-listen:
    bundle exec rake listen_information:xml

    run-spring:
    ./bin/spring server

    terminate-spring:
    ./bin/spring stop

    db-test: drop-db-test create-db-test migrate-db-test import-seed-test

    db-test-spring: migrate-db-test-spring import-seed-test-spring

    configure: fetch-rubocop fetch-makefile fetch-gemfile fetch-ignore fetch-ci install-bundle

    c: run-console

    s: run-server

    m: db-drop db-create db-migrate db-seed lint

    m: drop-db create-db migrate-db import-seed lint db-test

    ms: drop-db-spring create-db-spring migrate-db-spring import-seed-spring lint-spring db-test-spring
  16. smapira revised this gist Jul 28, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # curl https://gist.github.com/smapira/cc6a50f82cea034b07f02088c06b65dd/raw --output Makefile

    db-drop:
    bundle exec rake db:drop

  17. smapira created this gist Jul 28, 2020.
    81 changes: 81 additions & 0 deletions Makefile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,81 @@
    db-drop:
    bundle exec rake db:drop

    db-create:
    bundle exec rake db:create

    db-migrate:
    bundle exec rake db:migrate

    db-seed:
    bundle exec rake db:seed

    db-drop-production:
    RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:drop

    db-create-production:
    RAILS_ENV=production bundle exec rake db:create

    db-migrate-production:
    RAILS_ENV=production bundle exec rake db:migrate

    db-seed-production:
    RAILS_ENV=production bundle exec rake db:seed

    db-drop-test:
    RAILS_ENV=test bundle exec rake db:drop

    db-create-test:
    RAILS_ENV=test bundle exec rake db:create

    db-migrate-test:
    RAILS_ENV=test bundle exec rake db:migrate

    db-seed-test:
    RAILS_ENV=test bundle exec rake db:seed

    db-test: db-drop-test db-create-test db-migrate-test db-seed-test

    fetch-rubocop:
    curl https://gist.github.com/smapira/d07bd6464241cc559bef1548895b9af0/raw --output .rubocop.yml

    fetch-makefile:
    curl https://gist.github.com/gambala/4874e2b41a52ac043a274a61f5d7726b --output Makefile

    fetch-gemfile:
    curl https://gist.github.com/smapira/2dbc861e4212a2f86c3e0d09a7c6de27/raw --output Gemfile

    fetch-ignore:
    curl https://gist.github.com/smapira/a687e254eb10aa521cd1201c657af814/raw --output .gitignore

    fetch-ci:
    mkdir .circleci
    curl https://gist.github.com/smapira/b95f4cce9a78e9e256d2cb58f8c44084/raw --output .circleci/config.yml

    bundle-install:
    bundle install --path vendor/bundle --jobs 4

    lint:
    bundle exec rubocop -a -c .rubocop.yml

    security:
    bundle exec brakeman

    run-console:
    bundle exec rails console

    run-server:
    RAILS_ENV=production bundle exec rails s -b 0.0.0.0 -p 3000 -d

    terminate-server:
    kill -9 $(cat tmp/pids/server.pid)

    configure: fetch-rubocop fetch-makefile fetch-gemfile fetch-ignore fetch-ci bundle-install

    c: run-console

    s: run-server

    m: db-drop db-create db-migrate db-seed lint