Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Continuous integration, Documentation and Travis CI

Continuous integration, Documentation and Travis CI

Building docs on travis ci

Matthias Bussonnier

March 07, 2017
Tweet

More Decks by Matthias Bussonnier

Other Decks in Programming

Transcript

  1. Continuous integration,
    Documentation and Travis CI
    The Docathon Team, Matthias Bussonnier
    March 6, 2017

    View Slide

  2. ME
    Carreau
    Mbussonn
    [email protected]
    Physicist Bipophysics Software
    (Terribheu Freignch Akheucent)

    View Slide

  3. Travis CI

    View Slide

  4. What is Travis-CI
    • CI stand for “Continuous Integration”
    • Can run unit-test in isolation and complain if test fail
    • But Travis can run almost arbitrary code ...
    let’s use it for documentation

    View Slide

  5. Why for Documentation ?
    • Documentation is never complete, and evolve with your
    project
    • Your project is (likely) already setup for Travis
    • One less thing to think about, or configure, keep credential.

    View Slide

  6. .travis.yml

    View Slide

  7. How ?
    GhPages
    • Commits lands on the repository.
    • Travis builds and checks the docs.
    • If branch is “master”, push to GitHub Pages (for example)
    If Master branch

    View Slide

  8. The tricky part
    • Give Credential to Travis to push back to GitHub
    • Well, obviously not in plaintext.
    • If you committed once as plaintext: Change it.
    • Use “$ travis encrypt” to encrypt ssh keys.
    • Don’t “echo ENCRYPTED_VARIABLE”

    View Slide

  9. More details
    • Hands on tomorrow at The Hacker Within:
    • http://www.thehackerwithin.org/berkeley/
    • Every* Tuesday from 4pm to 4:30pm, Here

    View Slide

  10. Let’s use Magic
    • You likely don’t want to know how ssh/GitHub Api... etc.
    So let’s use DocTr (DOCumentation, TRavis)
    • Sets up credential for you
    • Tells you what to copy-past in travis.yml
    • Find the documentation folder
    • Push on GitHub

    View Slide

  11. https://github.com/drdoctr/doctr
    • $ pip install doctr
    • $ doctr configure
    • And follow instruction
    • Push a commit

    View Slide

  12. Go to
    https://.github.io/project/docs/

    View Slide

  13. View Slide

  14. ( Quick the attendees are hungry )
    Questions ?

    View Slide