Continuous deployment @ Coolblue
-
Upload
paul-de-raaij -
Category
Engineering
-
view
301 -
download
7
description
Transcript of Continuous deployment @ Coolblue
CONTINUOUS.Deployment.
PAUL.DevOp.
THE ROAD AHEAD.From new feature to deployment.
LANGUAGE AGNOSTIC.Same principles apply.
UNIT TESTS.All code is guilty, until proven otherwise.
UNIT TESTING.
• PHP– PHPUnit
• NodeJS– NodeUnit
• .NET– MSTest
CODING STANDARDS.Rules may apply.
FORKS.Personal cutlery.
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 complete.
BUILD CHAINS.
BUILD CHAINS.
REPORTING.REPORTING.
REPORTING.REPORTING.
BUILD SCRIPTS.Automate workflow execution.
BUILD STEP 1.Continuous inspection.
QUALITY ASSURANCE.
• Automated tests– Unit testing– Functional testing
• Static code analysers– Lint checkers– Code duplication checkers– Code sniffers
TOOLSET.
PHP * NodeJS .NET
PHPUnit NodeUnit MSTest
* PHP Template: http://jenkins-php.org
UNIT TESTING.
PHP * NodeJS .NET
PHPLint (php –l) JSHint Resharper
PHPCS Jscs
LINTING & CODING STANDARDS.
PHP * NodeJS .NET
PHPMD NDepend
PHPCPD
PHP_Depend
MESS DETECTION.
NODEUNIT.Easy asynchronous unit testing.
NODEUNIT.Easy asynchronous unit testing.
JSHINT.Detect errors and enforce coding conventions.
JSHINT.Detect errors and enforce coding conventions.
PHPCS.Detect violations of defined coding standard.
PHPCS.Detect violations of defined coding standard.
STATIC ANALYZERS.
• SonarQube– Extensive code quality management– Broad range of languages– Open Source
• SensioLabsInsight– PHP, XML, Yaml only– Security checks– Paid plans only
SENIORITY CHECK.Verify technical implementation.
MERGE PULL REQUEST.Integrate into the main repository.
ACHIEVEMENT.Continuous integration.
BUILD STEP 2: PACKAGING.Not a box of chocolates.
LINUX.
• Close to the OS• RPMs on package repository• Installed/Updated via OS package
manager– Updates triggered via puppet
RPMS ARE POWERFUL.
• Control over file permissions & rights• Clean uninstallation• Package managers are simple and well-
known• Easily distributed• No added complexity of third-party tools
BUILDING A RPM.Hard puzzle to crack?
BUILDING A RPM.Archive source files in a zip.
BUILDING A RPM.Create a spec file.
BUILDING A RPM.Create folder structure.
BUILDING A RPM.Run rpmbuild.
DEMONSTRATION.One demo a day, keeps the devil away.
CUSTOM RPM REPOSITORY.• Requirements:
– createrepo package– Sqllite database– HTTP or FTP server
• Run createrepo on folder with RPMS• Re-run createrepo after each change
• Tips:– Use gpg signing for production repositories– Organize your repository according architectures
WINDOWS.
• Octopus Deploy– Web Services– Desktop applications
• Workflow:– Builds NuGet packages– Deploys NuGet packages using tentacles– Installs them
OCTOPUS OVERVIEW.
OCTOPUS OVERVIEW.
OCTOPUS OVERVIEW.
BUILD STEP 3.Publish to test environment.
ACHIEVEMENT.Continuous delivery.
BUILD STEP 4.Publish to accept environment.
BUILD STEP 5.Publish to production environment.
ACHIEVEMENT.Continuous deployment.
ACHIEVEMENT.Continuous deployment.
CONTINUOUS.Delivery vs Deployment.
CONTINUOUS DELIVERY.
• Automated inspection• Automated delivery
– Except production
CONTINUOUS DEPLOYMENT.
• Continuous delivery• Automated deployment to production• Automated post-deploy tests
AUTOMATED DEPLOYMENT.
DEVELOP, TEST, DEPLOY, REPEAT.
Review & test
Write code
Commit & push
Open pull request
Build
Package
Staging
Production
Post-deploy tests
CHECK FOR SUCCESS.
• Website still up?• Working functionality?
AUTOMATE.Post-deploy smoke test.
MONITORING.Monitor application state.
STATISTICS.Measure everything.
FUNCTIONAL TESTS.Automated regression testing.
APPROACHES.
DEPLOY & REVERT.Revert in case of problems.
PRE-DEPLOYMENT TESTS.Run post-deploy test on acceptance environment.
CANARY DEPLOYMENT.Deploy to a cluster and do a live test.
DEVELOP, TEST, DEPLOY, REPEAT.
Review & test
Write code
Commit & push
Open pull request
Build
Package
Staging
Production
Post-deploy tests
Post-deploytests
ACHIEVEMENT.Continuous deployment.
PROBLEM/CHALLENGE.Reverting data/data sctructures.
GOOGLE IT.
• Canary deployment• Post-deploy tests• Continuous deployment• StatsD / Graphite• TeamCity / Jenkins / Octopus• Rpmbuild / createrepo
THANK YOU.Any questions?