How to CI & CD

Elixir Edition

Continuous Integration, Why Even?

running mix test on a server

Is this Continuous Integration?

Benefits

  • Faster Iteration
  • Better Communication
  • Prevents Som Defects
  • Reduces Work
  • Automated Boring Stuff

A Simple CI/CD Workflow

Great With Github

Text

Text

Text

Text

Text

Text

Text

Don't be too dogmatic; think of the children

Great Tools For CI/CD In Our Ecosystem

  • ExUnit (with or without coverage)
  • Dialyzer
  • Credo
  • Sobelow
  • The Formatter
  • ExDoc?
  • Distillery

Workflow Configuration

Describing the workflow should be separated away from implementing the steps. CirceleCI does a good job here.

workflows:
  version: 2
  continuous_integration:
    jobs:
      - build
      - test:
          requires:
            - build
      - check_formatted:
          requires:
            - build
      - credo:
          requires:
            - build
      - dialyzer:
          requires:
            - build
      - static_security_checks:
          requires:
            - build
      - hold:
          type: approval
          requires:
            - build
            - test
            - credo
            - dialyzer
            - check_formatted
            - static_security_checks
          filters:
            branches:
              only: master
      - deploy:
          requires:
            - hold
          filters:
            branches:
              only: master

Other Considerations

  • Git(hub) Workflow
  • Error Reporting
  • Alerts
  • Monitoring
  • Logging

From CI to CD

Being able to deploy without a manual step is the central concern of CD. Naturally it follows that you will do this after establishing a CI process and a the final step of that process.

Quick & Dirty CD on CircleCI

  • Keep it simple
  • Automat what you already have
  • Focus on tool you already understand

It's Ok To Have a Go Button

What About Hot Upgrades?

I don't Know

Quick Demo

Questions?

Contact

email: chase.gilliam@gmail.com

twitter: @ChaseGilliam

How to CI & CD; Elixir Edition

By Chase Gilliam

How to CI & CD; Elixir Edition

How to build a CI/CD pipeline for your Elixir apps

  • 237