Code Monkey home page Code Monkey logo

vets-website's Introduction

vets.gov - beta Build Status

Setup for your local environment

Requirements

If you don't have Xcode installed (for OS X), install from the Mac App store. Once installed, add command line tools by going to Preferences > Downloads > Components.

Next, you will need Ruby. You may consider using a Ruby version manager such as rbenv or rvm to help ensure that Ruby version upgrades don't mean all your gems will need to be rebuilt.

Normal installation.

Most development systems will already have the requirements installed including bundler and npm. If that describes you, just run

$ rake install

Bootstrap

If the requirements are missing, do the following.

On OS X, you can use Homebrew to install Ruby in /usr/local/bin, which may require you to update your $PATH environment variable. Once you have brew installed, here are the commands to follow to install via homebrew in terminal:

$ brew update
$ brew install ruby

Next run this rake task to ensure bundler and npm are installed.

$ rake bootstrap

Node Package Manager is used by Karma, the test runner for javascript. Karma is written in Node.js.

Running the website

  • Open terminal
  • 'cd' to directory (leave a space after 'cd', then drag and drop your site folder into the terminal window)
cd <path to vets-website directory>
  • Run site by using:
rake serve

Any changes made locally will cause the site to rebuild automagically.

Deploying the website

Deployment is done by pushing changes to the production branch on github. The most common paradigm is to promote master to produciton by doing a fast-forward merge into the branch. This can be accomplished via

rake deploy

If someone has had to push emergency changes to the production branch that have yet to be merged into master, then you will need "merge down" from production into master before doing a deploy. This will ensure that master has all the changes pushed to production. THIS SHOULD NOT HAPPEN NORMALLY. If this has occurred, run

rake mergedown

After this, ensure the CI on master goes green. Double-check staging as you've just introduced a new change to the code. If everything looks good, perform a deploy as described earlier to push all changes into production.

Development

When developing, you will want one terminal open window running the Jekyll server (see Running the website).

For testing, the following commands are useful:

rake tests:ci  # Rebuilds the website. Runs all tests that the CI system runs.
rake tests:ci_nobuild  # Same as above but w/o rebuilding for faster iteraion.

rake tests:all  # Rebuilds the website. Runs all tests, including slow ones. Superset of tests:ci
rake tests:all_nobuild  # Same as above but w/o rebuilding for faster iteration.

rake tests:htmlproof  # Runs HTML validation as a single-shot.
rake tests:htmlproof_external_only  # Runs HTML validation of external links only as a single-shot.

rake tests:javascript  # Runs all javascript tests as a single-shot.
rake tests:javascript_watch  # Runs all javascript tests continually watching for changes..

There is currently now way to automatically run htmlproof automatically on a change to a source file. Patches welcome!

Updating Karma.

If updating Karma, make sure to remember to rerun npm shrinkwrap to update npm-shrinkwrap.json (the npm equivalent of Gemfile.lock for Bundler).

vets-website's People

Contributors

dannychapman avatar ss0ss avatar bethpotts avatar awong-dev avatar lanaduffy avatar singletrackr avatar akainic avatar ahelkit avatar raineystraus avatar marinanitze avatar joesoftware avatar sjb912 avatar kreimann avatar llimllib avatar greggersh avatar rruuww avatar kharshawat avatar rcarthur avatar ericschles avatar rickleegit avatar openglobe avatar hollyallen avatar mollyblake avatar benbalter avatar alex avatar bijujoseph avatar konklone avatar nsinai avatar wslack avatar cfeeney-va avatar

Watchers

James Cloos avatar  avatar

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.