Giter VIP home page Giter VIP logo

dobetterascode's Introduction

DoBetterAsCode

CircleCI

A self-documenting repository/website demonstrating tools and practices for developing higher-quality "as code" with a fast feedback cycle.

See it live at DoBetterAsCode.com.

Set up

Ensure you have Docker installed and running. You will also need a Java installation to use the batect task runner.

To configure the pre-commit hooks, install the therapist python module and run therapist install in the cloned repository.

Folder structure

The "infra" folder is divided into "modules" of Terraform code, and the "project" which ties the modules together to create our static site hosted on AWS S3 with CloudFront.

The "app" folder contains a Hugo site which is compiled to HTML/CSS and pushed to S3.

The ".batect" folder contains Docker container defintions used for running tasks.

The ".circleci" folder contains our pipeline as code.

Test

Validation

The following local validation tasks may be run from batect:

terraform-tflint - runs tflint to ensure our Terraform modules have valid syntax and match the AWS validation rules provided by AWS SDK

pipeline-validate - runs circleci-cli to make sure our CircleCI pipeline as code is valid

yaml-lint - runs yamllint to ensure all our yaml files are well formed

shell-lint - runs shellcheck to check the syntax of our bash scripts and warn of possible bugs

Unit

terraform-local-apply - runs a terraform apply against an AWS mock powered by localstack
localstack limitations mean we are only able to test our S3 module at this point in time

Integration

Tests for our infrastructure modules are located in infra/integration-test. These tests use kitchen-terraform and awspec to create resources in AWS and then verify that the resources exist and meet our requirements.

The terraform-integration-test task runs the full suite of tests.
You can specify an individual test to run by providing the name to batect (e.g. ./batect terraform-integration-test -- certificate)

Hooks

The pre-commit hooks powered by Therapist will run all relevant validation tasks based on the files you are changing/committing.

dobetterascode's People

Contributors

ineffyble avatar priorax avatar doug-ferris-mondo avatar edsoncelio avatar moutons 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.