if you give a mouse a repository

46
$ whoami

Upload: seth-goings

Post on 11-Jan-2017

17 views

Category:

Software


1 download

TRANSCRIPT

Page 1: If You Give a Mouse a Repository

$ whoami

Page 2: If You Give a Mouse a Repository

$ whoamiSeth Goings ([email protected], @sethgoings)VP Engineering @ Deis

Page 3: If You Give a Mouse a Repository

$ who

Page 4: If You Give a Mouse a Repository
Page 5: If You Give a Mouse a Repository
Page 6: If You Give a Mouse a Repository

If you give a mouse a repository...

He’s going to want to fill it with a microservice!

Page 7: If You Give a Mouse a Repository

If he’s building a microservice...

He’s going to want to use containers!

Page 8: If You Give a Mouse a Repository

If he’s using containers...

He’s going to want to build it in a container!

Page 9: If You Give a Mouse a Repository

If he’s doing so much with containers...

He’s going to want to use a container orchestrator!

Page 10: If You Give a Mouse a Repository

If he’s using a container orchestrator...

He’s going to want to deploy more containers!

Page 11: If You Give a Mouse a Repository

If he’s going to be deploying all these containers...

He’s going to need a few more repositories.

Page 12: If You Give a Mouse a Repository
Page 13: If You Give a Mouse a Repository

… you’re in for a treat.

Page 14: If You Give a Mouse a Repository

What are today’s best practices?

Page 15: If You Give a Mouse a Repository

Should Docker be used during the build of an application?

Page 16: If You Give a Mouse a Repository

Should the use of Docker for builds be enforced on CI and developer

machines?

Page 17: If You Give a Mouse a Repository

Should you use a different Docker image while building vs. the image

you use to distribute your application?

Page 18: If You Give a Mouse a Repository

Is bundling Go based applications into Docker containers a good idea?

Page 19: If You Give a Mouse a Repository

What base image should you use?

Page 20: If You Give a Mouse a Repository

What are today’s best practices?

Page 21: If You Give a Mouse a Repository

Who makes these best practices?

Page 22: If You Give a Mouse a Repository

Why are the best practices changing nearly every day!?

Page 23: If You Give a Mouse a Repository

New tooling changes best practices

Page 24: If You Give a Mouse a Repository
Page 25: If You Give a Mouse a Repository

CodeUnit Test

Build Package

Deploy(to prod)

Deploy(to dev)

Publish

Test

Deploy(to test/stage)

Page 26: If You Give a Mouse a Repository

Code Unit Test

Build Package Run

Page 27: If You Give a Mouse a Repository

If he’s building a microservice...

He’s going to want to use containers!

Page 28: If You Give a Mouse a Repository

# Ensure go is installed

go build ... go test ...lint ...gox ...

# Ensure Docker is running

docker build ...docker tag ...docker push ...

Page 29: If You Give a Mouse a Repository

If he’s using containers...

He’s going to want to build it in a container!

Page 30: If You Give a Mouse a Repository

# Ensure Docker is running

docker run ... go build ... docker run ... go test ...docker run ... lint ...docker run ... gox …

# Spit out binaries onto local filesystem

docker build ...docker tag ...docker push ...

Page 31: If You Give a Mouse a Repository
Page 32: If You Give a Mouse a Repository
Page 33: If You Give a Mouse a Repository

$TOOL [build,unit-test,package,deploy <env>,publish,test <env>

]

Page 34: If You Give a Mouse a Repository

$TOOL == make

Page 35: If You Give a Mouse a Repository

make buildmake testmake docker_build#make docker_push

Page 36: If You Give a Mouse a Repository

The Good

● I can make the exact workflow I want

Page 37: If You Give a Mouse a Repository

The Bad

● It’s a Makefile.○ Up to date checks are poor / hard to wire up○ Makefile reuse is hard○ Need Makefile ninja skills...

Page 38: If You Give a Mouse a Repository

$TOOL == captainhttps://github.com/harbur/captain

Page 39: If You Give a Mouse a Repository

captain buildcaptain test#captain push

Page 40: If You Give a Mouse a Repository

The Good

● Solves the “How should I version my docker images” in a neat way

Page 41: If You Give a Mouse a Repository

The Bad

● But kind of just a wrapper on top of Docker:○ build

○ Push

● Context of build script = outside of container● Still some aspects of building, testing, pushing a project that aren’t wrapped

up in captain’s commands (see call to make in captain.yml)

Page 42: If You Give a Mouse a Repository

$TOOL == werckerhttp://devcenter.wercker.com/quickstarts/index.html

Page 43: If You Give a Mouse a Repository

#wercker dev...wercker build#wercker deploy

Page 44: If You Give a Mouse a Repository

The Good

● Docker centric workflow● Makefiles + code reuse● Context of build script = inside of container

Page 45: If You Give a Mouse a Repository

The Bad

● Tied somewhat to their SaaS offering● Can’t add toplevel commands (push AND deploy would be nice)

Page 46: If You Give a Mouse a Repository

$TOOL == ?