Git Product home page Git Product logo

wildland_dev_tools's Introduction

Wildland DevTools

This is a gem that contains all of our dev rake tasks. These are most useful for projects created by trailhead and are deployed on heroku using the pipeline feature. This allows for separate staging and production enviroments as well as review apps.

Checkout our Changelog for what has changed.

Installation

  • Add the following to your Gemfile:

gem 'wildland_dev_tools', '~>1.0'

Typically for wildland projects you will want to put this inside the dev/test block:

group :development, :test do
  ...
  gem 'wildland_dev_tools', '~>1.0'
  ...
end
  • Run bundle install to install the gem.

Heroku Tasks require the following steps

  • Install the heroku CLI.
    • For OSx users you can do this using brew by running brew install heroku.
  • Ensure you have your production and staging git remotes set.
    • heroku git:remote -a <staging-app> -r staging where <staging-app> is your heroku staging app name.
    • heroku git:remote -a <production-app> -r production where <production-app> is your heroku production app name.

Common Install Fixes

  • If bundle install borks on pg_config then set the Pg_config path with bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/{YOUR VERSION}/bin/pg_config

Usage

You will get a new batch of new rake tasks under the wildland namespace. For a full list run rake -T.

Common Development Tasks

  • rake wildland or rake wildland:setup This will run all of the setup tasks to get your local enviroment ready to go.
  • rake wildland:db This will resetup and seed the local database.
  • rake wildland:cache_clear This will clear the local app-ember package cache.

Code Quality Tasks

  • rake wildland:pre_pr or rake wildland:pre_pull_request This will run all pre-pull request checks.
  • rake wildland:pre_pull_request:fixme_notes Print only FIXME notes
  • rake wildland:pre_pull_request:html Run brakeman & rubocop with html formats and save them to /reports
  • rake wildland:pre_pull_request:js_debugger Find js debugger statements
  • rake wildland:pre_pull_request:notes Create a report on all notes
  • rake wildland:pre_pull_request:rubocop_recent Run rubocop against all created/changed ruby files
    • rake wildland:pre_pull_request:rubocop_recent[autocorrect] This perform the deploy as above, but have rubocop attempt to autocorrect issues.

Heroku Tasks

Deploying

  • rake wildland:heroku:deploy_to_staging This will deploy master to staging. This will automatically create a release candidate git tag.
    • rake wildland:heroku:deploy_to_staging[verbose] This perform the deploy as above, but in verbose mode.
    • rake wildland:heroku:deploy_to_staging[verbose,force] This perform the deploy as above, but this will --force deploy master to staging.
  • rake wildland:heroku:deploy_current_branch_to_staging This will promote your current branch to staging as master. This will NOT automatically create a release candidate git tag.
    • rake wildland:heroku:deploy_current_branch_to_staging[verbose] This perform the deploy as above, but in verbose mode.
    • rake wildland:heroku:deploy_current_branch_to_staging[verbose,force] This perform the deploy as above, but this will --force deploy your current branch to staging.
  • rake wildland:heroku:promote_to_production This will promote staging to production. This will automatically create a production git tag.
    • rake wildland:heroku:promote_to_production[verbose] This perform the deploy as above, but in verbose mode.

Utility

  • rake wildland:heroku:maintenance_mode_on This turns on maintenance mode for staging and production.
  • rake wildland:heroku:maintenance_mode_off This turns off maintenance mode for staging and production.
  • rake wildland:heroku:backup_production_database This will create a backup of the production database.
    • rake wildland:heroku:backup_production_database[verbose] This perform the deploy as above, but in verbose mode.
  • rake wildland:heroku:import_latest_production_database_backup This will import the latest production database backup to your local database.
    • rake wildland:heroku:import_latest_production_database_backup[verbose] This perform the deploy as above, but in verbose mode.

Code Of Conduct

Wildland Open Source Code Of Conduct

wildland_dev_tools's People

Contributors

jweakley avatar samsinite avatar harokevin avatar ike avatar

Watchers

Angela Thomas avatar  avatar James Cloos avatar Ken Schmidt avatar Brett Spooner avatar Nathan Ockerman avatar Jiro Farah avatar Tyler Soldat avatar

wildland_dev_tools's Issues

Document required remote names in git config

Currently this gem does not document how to correctly setup the wildland_dev_tools gem. To correctly use this gem, the user needs both staging and production defined as remotes in their git config for the project.

Smarter remotes

The tool should suggest heroku app remotes if they are missing

Improve deploy script

  • heroku errors should raise exceptions.
  • heroku rollback should handle database rollbacks.

Add clear cache to this

npm cache clean && bower cache clean && rm -rf node_modules && rm -rf bower_components && npm install && bower install

Move to parity

We should move to just using https://github.com/thoughtbot/parity under the hood for our heroku commands.

Fix rake wildland:setup

module.js:338
    throw err;
          ^
Error: Cannot find module 'rsvp'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/ty/Sites/denovo/app-ember/node_modules/ember-cli/lib/ext/promise.js:3:15)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

Add NVM use to rake wildland

If the ember command is not recognized on the system then the ember install or npm install will not work.
Using nvm use on the ember directory would fix this issue.

Heroku maintenance mode off broken

module.js:557
    throw err;
    ^

Error: Cannot find module '/Users/jweakley/.local/share/heroku/client/package.json'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at run (/Users/jweakley/.local/share/heroku/client/node_modules/@cli-engine/engine/lib/cli.js:82:22)
    at Object.<anonymous> (/Users/jweakley/.local/share/heroku/client/bin/heroku.js:7:1)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
Turning off maintenance mode for production
module.js:557
    throw err;
    ^

Error: Cannot find module '/Users/jweakley/.local/share/heroku/client/package.json'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at run (/Users/jweakley/.local/share/heroku/client/node_modules/@cli-engine/engine/lib/cli.js:82:22)
    at Object.<anonymous> (/Users/jweakley/.local/share/heroku/client/bin/heroku.js:7:1)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)

Make wildland:setup rake taks public

Convert the methods to be public and over writable for custom wildland:setup rake task in project.

  1. Rails Version Check
  2. NPM Install & old Ember dependancies
  3. Database setup

Update db:setup to drop DB

The database should be generated from scratch when this command is run for ease of use. Otherwise the seed task could potentially fail with validation errors due to existing data. rake db:drop needs added to this task.

Investigate image diffing

We should at some point consider integrating image diff'ing to help our QA process so that we can more easily identify things like css or component UX visual regressions. Using headless chrome, we can take screenshots of the window and compare with a library like https://github.com/mapbox/pixelmatch. We don't have to use pixelmatch, just putting it here because it was the first thing I found.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.