Giter Site home page Giter Site logo

bcda-static-site's Introduction

Beneficiary Claims Data API

A static Jekyll site for the BCDA splash page: https://bcda.cms.gov

Requirements

It is assumed that the environment already has these installed:

  • rbenv or rvm to install versioned ruby
  • ruby currently using 2.7.1
  • jekyll currently using 4.2.0
  • npm currently using 6.13.4
  • Docker to standardize builds across all contributors' local machines
  • Docker Compose to define and run multi-container Docker applications

Installation

Navigate to the repository, and install the appropriate Gem file (a Gem file includes the dependencies for Ruby apps):

  1. $ gem install bundler <— install Gem bundler
  2. $ bundle install <— install Gem bundles
  3. $ npm install <- install node dependancies

Local builds

Jekyll builds the CSS and HTML pages. Run bundle exec jekyll serve from the project root for a local build. By default, the site will run in http://localhost:4000/. You can also run bundle exec jekyll build to compile the site files into the _site directory.

Using Docker for distributed builds

Every contributor that uses Docker will have the exact same build as every other contributor. The command for a consistent and simple build process is:

docker-compose -f docker-compose.yml build static_site
docker-compose -f docker-compose.yml run --rm static_site

This process uses a Docker container to execute bundle exec jekyll build , compiling site files into the same _site directory used when executing this command on the Docker host. The advantage here is that there's no need to install ruby or any dependencies on the machine building the static site — Docker takes care of all that.

Using Docker for serving

To host the site in Docker, accessible at http://localhost:4000/:

docker-compose run --publish 4000:4000 --rm --entrypoint "bundle exec jekyll serve -H 0.0.0.0" static_site

This is a convenience meant to ease integration of static site builds with the larger BCDA CI/CD pipeline.

Installing and Using Pre-commit

Anyone committing to this repo must use the pre-commit hook to lower the likelihood that secrets will be exposed.

Step 1: Install pre-commit

You can install pre-commit using the MacOS package manager Homebrew:

brew install pre-commit

Other installation options can be found in the pre-commit documentation.

Step 2: Install the hooks

Run the following command to install the gitleaks hook:

pre-commit install

This will download and install the pre-commit hooks specified in .pre-commit-config.yaml.

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.