Continuous Delivery for Alfresco Solutions Satisfied customers and happy developers with!! Continuous Delivery!
About me Roeland Hofkens #rhofkens roeland.hofkens@westernacher.com http://opensource.westernacher.com CTO Westernacher Products and Services AG Over 15 years of ECM experience Over 3 years of Continuous Delivery experience!
Introduction Embrace Continuous Delivery for: Satisfied customers!!! Happy developers! How can we use CD successfully in Alfresco Solutions?!
Agenda What is Continuous Delivery? How can CD be used for Alfresco Solutions? Best practices! Pitfalls! Live demo! Demonstration of Continuous Delivery in the Westernacher Development Environment!
What is Continuous Delivery (CD)? Cornerstones of Continuous Delivery Each check-in creates a potential release Each check-in (or a batch of check-ins) triggers a build & the related tests Each build is automatically deployed on a production-like test system Automated tests are executed on the newly deployed system Infrastructure is code All steps in the process are fully automated. Tools are required. Landscape configuration is externalized and versioned Each step provides immediate feedback (success & failure) Enables the developer team to act on it immediately What does this mean?! At each moment in time we have a verified build that could potentially be released to production!
Continuous Delivery in context Easy Level of Complexity Continuous Integration Level of Automation Each check-in creates a build! Code level analysis! Unit testing! Guarantees code quality and consistency across the team!
Continuous Delivery in context Challenge Easy Level of Complexity Continuous Integration Continuous Delivery Level of Automation Each check-in creates a release candidate! Fully automated deployment to test production-like env.! Push-button deployment to production! Guarantees that code is always in a state that can be release to production! Guarantees availability of latest features for customer testing at all times!
Continuous Delivery in context Complex Challenge Easy Level of Complexity Continuous Integration Continuous Delivery Continuous Deployment Level of Automation Each check-in produces a new production release! Requires 100% test coverage and trust in the build! Sophisticated deployment techniques required! Guarantees availability of latest improvements to end users at all times!
Continuous Delivery toolset Tests Ticket System Build Server Coverage Analysis Smoke Tests Load Tests IDE DEV ENV Artifact Repo Deployment Framework Source Code Control System Virtual Machine Manual QA
CD Toolset @Westernacher Ticket System JIRA Build Server Bamboo Tests Coverage Analysis Smoke Tests Load Tests junit Sonar Selenium for Smoke and UI tests jmeter for load tests IDE DEV ENV Eclipse Artifact Repo Artifactory Chef Deployment Framework SVN, Git Source Code Control System Virtual Machine VMWare vsphere Manual QA
Continuous Delivery advantages Satisfied customers
Continuous Delivery advantages Happy developers
CD & Alfresco: Best practices (1) Use consistent Alfresco project templates Every project has the same structure 3 levels: Root Repo Share Every project is built in the same way Version your templates
CD & Alfresco: Best practices (2) Build with Maven or Gradle Use dependency resolution Alfresco now offers a Maven Repo Can also be accessed with Gradle Westernacher uses Gradle Increased flexibility Groovy DSL for build tasks AMP Plugin for Gradle
CD & Alfresco: Best practices (3) Use AMPs to package your deliverables Always create two AMPS Repo Share Don t put landscape dependent config in your AMPS alfresco-global.properties share-config-custom.xml Develop an AMP that shows build information in Alfresco
CD & Alfresco: Best practices (4) Only build your binaries once One binary fits all landscapes Regressions not possible Configuration is externalized 1 Stored in SCM Versioned and managed as code Fed into deployment framework
CD & Alfresco: Best practices (5) Support multi-module deployments Design modular solutions Package all your extension in AMPS Solutions are composed of multiple AMPS Use flexible deployment configurations Module composition in configuration file Linked to artifact repo to allow dependency resolution and versioning
CD & Alfresco: Best practices (6) Use a deployment framework Deployment frameworks take the pain out of deployment tasks Repositories with scripts available Handle the externalization of configuration easily Westernacher uses Chef Open Source with commercial support Large community Ruby scripting, JSON config
CD & Alfresco: Best practices (7) Deploy two instances on the same VM Continuous Build instance Redeployed on every build Verifies delivery Dynamic environment for automated testing 2 Nightly Build instance Only runs when CB build is green Stable environment for manual QA testing
CD & Alfresco: Best practices (8) Support shallow and deep deployments Deep Set up complete Alfresco system from scratch Clean DB, repo and indexes 2 Shallow Only update web apps Don t touch the repo
CD & Alfresco: Best practices (9) Create Alfresco data loaders Data is needed for automated testing Bootstrap initial settings using Alfresco bootstrap mechanisms Folder templates Categories, users, Use your REST APIs to load data Can double as load tests Excellent sample code on how to use your API
CD & Alfresco: Best practices (10) Use the (private) cloud Fact: you ll need plenty of VM s Create VM templates with OS Include basic environment and chef client Public cloud e.g. Amazon EC2 Ideal for load testing Ideal for short research projects Private cloud Westernacher uses vsphere 5 Cost effective for daily use
CD & Alfresco: Common pitfalls (1) Unrealistic time planning Setting up a CD environment is a complex task Take your time Allow lots of room for refactoring of the pipelines Work Agile Same rules apply as for software projects Short cycles, deliver often
CD & Alfresco: Common pitfalls (2) No involvement of system admins & IT stakeholders Involve your system administrators Make sure they understand the need Show the advantages for sys admins Have the sys admins create the cookbooks & recipes Plan in compliance to IT policies from the start Changing afterwards is a big effort Increase acceptance
CD & Alfresco: Common pitfalls (3) Developers don t understand the importance of a green build Evangelize CD Communicate the advantages Everybody in the team is responsible for the build Make CD easy Show working examples Create end-to-end sample pipelines for copy & paste
Live Demo: An Alfresco CD Build Pipeline
Questions & Answers
Thank you!