Continuous deployment @ Tweakers Developers Summit

Post on 21-Feb-2017

85 views 3 download

transcript

DEPLOYMENT.@ Coolblue.

PAUL.Technical Pathfinder

DEVELOPMENT

187

30TEAMS

DEPLOYING SOFTWARE.Delivering packaged high quality software on servers.

• +/- 50 deploys per day on all platforms

• Single button deployment

• Developers do their own deployment

FACTS AND FIGURES.

GATHER LEARNINGS FAST.By releasing often and quick.

LANGUAGE AGNOSTIC.Same principles apply.

DEVELOPING FEATURE 'X'.Smiling customers.

UNIT TESTS.All code is guilty, until proven otherwise.

CODING STANDARDS.Rules may apply.

More Octocats at https://octodex.github.com/

FORKS.Personal cutlery.

GITHUB FLOW.Fork & Pull model.

PULL REQUESTS.Share, review and discuss.

PULL REQUESTS.Small commits, small context.

TEAM CHECK.None of us is as smart as all of us.

QUALITY CONTROL.Check standards have been met.

BUILD SERVER.Construction completed.

TEAMCITY.Central point of inspection and deployment.

BUILD CHAINS.Sequence of build steps with specific purpose.

BUILD SCRIPTS.Describe automation workflow.

RECYCLE YOUR CONFIGURATIONS.Create a default for all projects and allow overrides.

BUILD CHAINS.Sequence of builds with specific purpose.

BUILD STEP 1.Continuous inspection.

• Automated tests • Unit testing • Functional testing

• Static code analysers • Lint checkers • Code duplication checkers • Code sniffers • Code metrics

QUALITY ASSURANCE.

BE LAZY; YOU DON’T HAVE TO DO IT YOURSELFContinuous inspection platform are becoming a service.

REPORTING ON EACH PULL REQUEST.Integrating all information available.

Examples:

• Scrutinizer

• SonarSource

• Codacy

CONTINUOUS INSPECTION PLATFORMS.

MERGE PULL REQUEST.Integrate into the main repository.

REMEMBER GITHUB FLOW.Merge it in the master branch of the original repo.

ACHIEVEMENT.Continuous integration.

BUILD STEP 2: PACKAGING.Not a box of chocolates..

• Close to the OS • RPMs distributed via own repository • Installed/Updated via OS package manager

• Updates triggered via puppet run

LINUX.

• Control over file permissions & rights • Clean uninstallation • Package managers are simple and well-known • Easily distributed • No added complexity of third-party tools

RPMS ARE POWERFUL.

• Octopus Deploy so we can deploy: • Web Services • Windows services • Desktop applications

WINDOWS.

OCTOPUS DEPLOY.Pushing packages to servers.

BUILD STEP 3.Publish to test environment.

ACHIEVEMENT.Continuous delivery.

BUILD STEP 4.Publish to acceptance environment.

BUILD STEP 5.Publish to production environment.

ACHIEVEMENT.Continuous deployment.

ACHIEVEMENT.Continuous deployment.

CONTINUOUS.delivery vs deployment

• Automated inspection • Automated delivery

• Except production • May have automated post deployment tests

Every change is proven to be deployable!Deployment after manual trigger

CONTINUOUS DELIVERY.

• Continuous delivery • Automated deployment to production • Has automated post-deploy tests

CONTINUOUS DEPLOYMENT.

POST-DEPLOYTests

• Website still up? • Does the functionality work?

• New functionality • Old functionality

• especially old functionality (regression)

• Haven’t I killed the infrastructure?

CHECK FOR SUCCESS.

AUTOMATE SMOKE TESTS.Validate essentials are correct.

MONITORING.Monitor infrastructure state.

APPLICATION STATISTICS.Measure everything.

give you uplet you downrun you down & desert youmake you crysay goodbyetell a lie & hurt you

HEARTBEATIs your application still alive?

FUNCTIONAL TESTS.Automated regression testing.

APPROACHESautomated deployment

DEPLOY & REVERT.Revert in case of problems.

PRE-DEPLOYMENT TESTS.Run post-deploy test on acceptance environment.

CANARY DEPLOYMENT.Deploy to part of a cluster and test in production.

• Deploy to part of the cluster

• X% percentage live

• A/B testing (?)

CANARY DEPLOYMENT.

ACHIEVEMENT.Continuous deployment.

DEVELOP, TEST, DEPLOY, REPEAT.

Review & testWrite code

Commit &

push

Open pull

request

Build

Package

Staging

Production

Post-deploy

tests

Post-deploytests

PROBLEM / CHALLENGE.Reverting data/data structures.

NUTS.Are you.

NO TESTERS NO QUARANTINE

NO 1000+ PAGE TEST SCRIPT NO SIGN-OFF

TAKING RISKS.What suits your comfort zone.

GATHER LEARNINGS FAST.By releasing often and quick.

WAIT A MINUTEWhat do you actually have in place

• Automated smoke tests on acceptance environment

• User acceptance tests (AKA The PO test)

POST-DEPLOY TESTS @ COOLBLUE.

REVIEWING OUR BUILD PIPELINE.Build steps in our continuous delivery currently.

TESTING DEPLOY & REVERTA few services have continuous deployment as a test.

CANARY DEPLOYMENT.Feature switches for the win.

CONTINUOUS DELIVERY.

FEEDBACK.You got something to say.

• p.deraaij@coolblue.nl

• @pderaaij

• http://slideshare.net/pderaaij

• http://devblog.coolblue.nl/

• http://careersatcoolblue.com/

THANK YOU.