Slide 1

Slide 1 text

the best way to build and ship software GitHub + CI/CD

Slide 2

Slide 2 text

the best way to build and ship software ! CD Definition 2 automated software delivery process covers build, deploy, test, release " • know that you can get (machine-level) feedback w/o asking anyone for it

Slide 3

Slide 3 text

the best way to build and ship software ! CD - Why 3 •reduces cycle time •lower stress •admits granular releases •improves feedback at all stages •increases time for creative work •measures failure or success consistently

Slide 4

Slide 4 text

the best way to build and ship software CD - What 4 # $ ! FAST RELIABLE (incl. repeatable) • caveat: process varies greatly by application

Slide 5

Slide 5 text

the best way to build and ship software ! 5 % & " BUILD UNIT TESTS ACCEPTANCE TESTS MANUAL TESTS RELEASE Deployment Pipeline each commit triggers new instance of pipeline (which typically won't reach final stage) 1. system works at technical level 2. system works at functional level, meets specs 3. exploratory, integration envs, UAT 4. deliver system to users

Slide 6

Slide 6 text

the best way to build and ship software ! 6 ' ( DELIVERY DEPLOYMENT manual automated Continuous [ ]

Slide 7

Slide 7 text

the best way to build and ship software ! Production-Like 7 ) * + LIVE CUSTOMER TRAFFIC or possibility of it SAME OS, SOFTWARE no dev tools MANAGED LIKE PROD provisioning, &c.

Slide 8

Slide 8 text

the best way to build and ship software ! Role of GitHub Platform 8 record of how they went source for deploys , - • Integrations, API enable this • GitHub = Central, highly visible

Slide 9

Slide 9 text

the best way to build and ship software ! CI Goals 9 . / 0 CATCH BUGS EARLY REDUCE MERGE CONFLICTS REGULARLY PROVE APP WORKING • primary goal: provide fast, useful feedback on most common failures • bugs easier to fix when fresh in mind • merge conflicts detested, and take unpredictable amount of time to resolve • nb: proving app works for given config, env • devs integrate ops’ perspective

Slide 10

Slide 10 text

the best way to build and ship software ! Continuous Integration 10 •build/test every push •display results prominently process, not tool • tests means to an end, not end in and of themselves • highest benefit/cost ratio of any step in deploy pipeline

Slide 11

Slide 11 text

the best way to build and ship software ! Human Response 11 feedback useful iff fast 1

Slide 12

Slide 12 text

the best way to build and ship software ! Implementing CI 12 cultural requirements •agreed failure threshold •test locally first •never base work on broken build •revert if needed •share code ownership *always exceptions, e.g. tests taking too long locally • local tests = quickly id any problems (esp. common when `master` updated since proj started); keeps `master` working while you fix what you'd have to fix anyways • prioritize fixing breaking changes • revert especially if fix taking longer than some threshold amount of time • anyone can refactor “others’" code

Slide 13

Slide 13 text

the best way to build and ship software ! 13 2 3 4 EVOLVE MODULAR LOGICAL STRUCTURE NOT ENV- SPECIFIC Designing Tests • as dev progresses, supplement w/ a few more involved checks for common failures • prioritize commit stage scripts as you would source code

Slide 14

Slide 14 text

the best way to build and ship software ! Designing Tests 14 • fail fast • not always at first error •broader failure criteria • architecture violation • slow test • increased warnings • style breach

Slide 15

Slide 15 text

the best way to build and ship software Continuous Deployment 15 ! delays in execution of (and thus feedback from) testing/ops after dev "done" is often a major bottleneck

Slide 16

Slide 16 text

the best way to build and ship software ! Deploy Steps 16 deploy desired version of app into this env create, config infrastructure on which app will run 5 6 1. includes hardware, networking, middleware, external services 2. app should be built already

Slide 17

Slide 17 text

the best way to build and ship software ! Deploy Steps 17 7 8 9 configure app run deploy tests 1. includes req’d data, state 2. make sure app is up and running, external services working; give basic diagnostics if app won't run

Slide 18

Slide 18 text

the best way to build and ship software ! Infrastructure: Principles, Goals 18 •same process for managing all environments •declarative, •idempotent •automated •autonomic CAN YOU DEPLOY FROM SCRATCH ON VANILLA SEVERS? • changes to configs can be more dangerous than changes to source code — latter typically better guarded against (compiler, tests)

Slide 19

Slide 19 text

the best way to build and ship software ! Automation > Documentation 19 • reduces risk • automated = auditable • enforces consistency • simpler error diagnosis • simpler to recreate

Slide 20

Slide 20 text

the best way to build and ship software ! Build/Deploy Automation 20 •build once • rebuild inefficient • introduce new errors •same deploy process for all envs •in effect testing “deploy to prod” process •eliminate “works on my machine” •encourages all to test more

Slide 21

Slide 21 text

the best way to build and ship software Anti-Pattern #1 DoS your own servers 21 :

Slide 22

Slide 22 text

the best way to build and ship software ! 22 9 USE WEBHOOKS SET UP PROXY FOR API CALLS (if you must) Say No to Agressive Polling every single dep’t in GitHub calls this public enemy #1