Development is easy these days

Tomáš Tomeček
Red Hat

Intro

  • Engineer @ Red Hat
  • Codes a lot
  • Doing containers again

Why?

  • Share the knowledge

Full workflow

  • Setting up a development environment
  • Tinkering terminal environment
  • Writing code
  • Running code
  • And of course testing code
  • Deploying code

Runtime environment

  • Separate your project from others
    • Ecosystem based
      • virtualenv
      • RVM
      • npm/go/rust out of the box
    • System based - containers
    • Virtualization (vagrant)

Automate!

  • Don't be shy with makefiles
    • Or whatever the community is suggesting

Terminal environment - shell

  • Tinker your shell
  • Improving prompt
    [user@hostname this-directory] 
    user@hostname ~/g/this-directory [→2] [master|3+] 
  • Use aliases, please!
  • Petr Hodač: today 12:15, Pokročilé tipy a triky v shellu.
  • Michal Halenka: today 14:30, Z shell

Terminal environment

  • Terminal multiplexer (tmux)
  • Easy filesystem navigation (autojump)
  • *-sensible

Editor

  • Pick the right one
  • And become a ninja in your editor
  • E.g. I picked vim
  • Petr Hodač: in parallel, VIM - advanced

Code

  • Style conventions
  • go-fmt, autopep8
  • Static analysis - linter
  • Reviews

Running the code


FROM fedora
RUN dnf install -y @dependencies
COPY . /app
CMD ["/app/start-the-app"]
					

Running the code II


FROM fedora
RUN dnf install -y @compiler @libraries
COPY . /app
WORKDIR /app
CMD ["make"]
					

Running the code III

docker-compose up

Tests

  • CI
    • Travis CI
    • CircleCI
  • Running tests
  • Integration tests

Running tests


FROM the-app-image
RUN dnf install -y @dependencies @test-libraries
CMD ["make", "unit-test"]
					

git

  • Rebase
  • cherry-pick
  • reset --hard
  • Resolving conflicts
  • tig

tig

Dotfiles

  • Public/private
  • Submodules
  • Install script
  • stow

Invitation to our workshop

  • E112, Sunday, 10.00 - 13.00
  • me and Peter Schiffer
  • Containers: workshop
  • Bring your own projects you want to containerize

Questions are welcome!

  • TomasTomecek/openalt-2016-talk
  • @TomasTomec