How painful was your last release? Continuous Integration Marcin Kawalerowicz CEO CODEFUSION Sp. z o. o. CODEFUSION Sp. z o.o. ul. Powstańców Śląskich 25/18 45-086 Opole, Poland +48 77 54 53 312 info@codefusion.pl
After the session you will know what continuous integration (CI) is and why it s worth to use it. You will be able to build small but complete CI process. You will know what to do if the build fails.
It is an automated process that builds (link, compile, tests, analyzes, deploy, ) the software after each change in source code, to ensure its health (weather it functions correctly, follows best practices, is deployable, ) provides immediate feedback especially if it s not well.
To fight the integration hell To detect every drop in source code quality To reduce risk To increase the software development process transparency To increase the quality of software To ensure good practices and rule obedience while coding To develop faster with fewer bugs To easily create deployable software Side effect: ensure smooth start for new developers
Command line mini CI
Prepare -> Check-> Compile -> Test/deploy-> Problem? -> Wait->
Source code control Build automation CI server Feedback mechanism Unit testing framework Code analysis
Use version control no excuses!!! Vanilla CI server Everyting in repo Including: libs, tools, scripts Excluding: SDKs, Frameworks Clean project strucure
Keep everything you need in repository Organize files in groups
Script as text Under version control in the same repo Path agnostic Of course DRY don t repeat yourself (use variables, externalize configuration, use system variables, parametrize)
Is it still a duel? NAnt MSBuild OpenSource Cross-platform Good if you already know Ant Build-in to.net Framework Integrated with Visual Studio Actively developed Build in features
Transition from directed graph to taks loop
How much money do you have to spend? Do you want to pay the angle bracket tax (XML) configuration overhead? Is it supporting the tools that you need? How good is the documentation and support? Does it do what you want it to do? Does it do more than you need not just now but into the future? Is it easy to use? Is it cool and hip?
Aspekt TFS Hudson/Jenkins TeamCity CC.NET Koszt Konfiguracja Narzędzia Dokumentacja Funkcje Dodatki Łatwość użycia Cool
Bamboo Anthil Cruise Go CI is about what people do, not about what tools they use
Manual / Forced Continuous Integration Poll vs. Push (using hooks) Rolling build (every x check-ins or x seconds) Scheduled (Daily / Nightly / Weekly / ) Triggered by another build
make your unit tests fast and unambiguous have your unit tests as few dependencies as possible let errors drive your unit tests mock external interfaces
Tools: Selenium (Web) White Framework (Win, Silverlight) Fitnesse (Acceptance) Visual Studio UI Automation (Web, Win)
Not everything considerable for CI Other System Functional Integration CI Unit
perform the quick tests at the beginning break the build after first failing test Unit tests Integration tests System tests Other tests
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
FxCop / VS Code Analysis IL code analyze FxCop and Visual Studio Code Analysis Extending FxCop CI integration
StyleCop C# code analyze Extending StyleCop CI integration
give information about any decrease of your code quality be quick be able to provide information in diverse art point to the specific place that caused this deterioration be accessible to any team member, anytime
Tray notifiers Alternative notifiers Email Sms Instant messaging Gadgets
no one pulls anything from source control. The source is broken so no one should be interested in broken code someone should jump right in to fix the problem, preferably the person that caused it, but volunteers are welcome all the commits to the repository are withheld until the build is fixed. If you push good code into a spoiled repository your code might get the smell too
Why not? Database as script (in repo) Automatic DB creation Automatic DB migration and seeding Parameter externalization Integration with every change
Liquibase Dbdeploy MIGRATEdb Dbmaintain AutoPatch
Generating documentation (Sandcastle) XML- Dokumentationskommentare in Quellcode Kompiler XML Dokumentation Sandastle CHM/HTML-Dokumentation Deployment (Wix, MSDeploy) UI automation
Getting x last build to success Sunny / Clouded / Storming in Jenkins
When: Code base / test no. increases -> build time increases Teams growth No. of projects grows Then Create targeted builds (dev build, qa build) Write fast unit tests Smaller teams with local integration servers Modularize the code base Scale hardware Add more build agents Parallelize
Quick integration = more frequent integration = high quality source code It should take no more then 5-10 minutes. Scaling Continuous Integration, R. Owen Rogers, Lecture Notes in Computer Science, 2004, Volume 3092, Extreme Programming and Agile Processes in Software Engineering, Pages 68-76
Software Developer + IT Professional = Build Master DevOps
Continuous delivery Deployment pipeline Commit stage Acceptance stage Self serviced deployments Push button releases
CI
Marcin Kawalerowicz CEO CODEFUSION Sp. z o. o. www.codefusion.pl marcin@kawalerowicz.net Blog: www.iprogrammable.com LinkedIn: www.linkedin.com/in/marcinkawalerowicz Book: www.amazon.com/dp/1935182552 CODEFUSION Sp. z o.o. ul. Powstańców Śląskich 25/18 45-086 Opole +48 77 54 53 312 info@codefusion.pl