2013 09 drupalcamp leuven deployments en workflow

  • 211 views
Uploaded on

Deployments and workflow …

Deployments and workflow
Drupalcamp Leuven 2013

Frederik Wouters

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
211
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
3
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Deployments & workflow Frederik Wouters
  • 2. Who am I
  • 3. Frederik Wouters • Drupal user profile since 2010 • Create issues/patches on d.o. • Freelance Drupal 6/7 • Working for Q-music at the moment
  • 4. Agenda - Working alone - Working in a small team - Working in a large team - Releases and Deployments - Workflow models
  • 5. IF YOU ARE ALONE It’s just you and the server
  • 6. FTP SSH …
  • 7. Client wants a change • Look at code • Make change • Upload Code • It’s not complicated • No overhead • If feels good • Always up to date What can go wrong?
  • 8. Working in a small team?
  • 9. Some teams FTP SSH … DEV DEV DEV
  • 10. Client want changes • Get code from ftp • Make changes • Upload • It’s not complicated • No overhead • If feels good • Always up to date
  • 11. CODE IS LOST You knew it was coming
  • 12. HELLO VCS FTP / SSH / … DEV DEV LEAD
  • 13. Client want changes • Check out latest version • Make changes to master • Commit • Deployer deploys
  • 14. MULTIPLE DEVELOPERS No problem
  • 15. TL;DR Prepare for scaling, even if you’re alone Use git
  • 16. Working in a bigger team
  • 17. Assume • Production / Acceptance / Dev environment • Code is tested before Acceptance • Multiple people are working on several features at the same time.
  • 18. Concept: BRANCHES
  • 19. Client want changes Hotfix • Check out acc/prd • Make changes • Commit • checkout dev/acc • Cherry pick • Commit Feature • Check out dev • Make changes • Commit
  • 20. HOW TO IMPROVE • Deployment • Workflow
  • 21. DEPLOYMENT
  • 22. How do the big fish deploy? Facebook Code is compiled to one big executable This blob is deployed with bittorrent Twitter “Murder” (Capistrano + optimised bittorrent) Google YADT : yaml datacenter management
  • 23. DEPLOYING TO PRODUCTION I merged branches
  • 24. Automate deployments No matter what your workflow is, you will always profit from automatic deployments Frederik Wouters
  • 25. Automate deployments • Jenkins – Open source (dev’s love it) – A lot of components • Capistrano – Open source (Ruby devs love it) – Command line • Bamboo – Integrated with Jira (PM’s love it) – Nice issue tracking and all
  • 26. Commit based deployment • Github • Bitbucket Committing will trigger a build of a specific branch to a specific environment. https://github.com/wieni/jenbucket
  • 27. How to set it up? Github/bitbucket hook: • Github:
  • 28. How to set it up? • Apt-get install jenkins • Install some plugins – ftp publisher – Ssh publisher – Ssh credentials – Git client – Google calendar – Html5 notifier – Jquery – Mailer – Subversion – Workspace cleanup – ….
  • 29. How to set it up? Job conf: • Enter your git repo • Add build config – Build a tarball from codebase – Ssh publish the code – Create DB dump before – Symlink of files directory between deployments – Save a copy of prev codebase (just in case) – Drush updb, cc , fra , dis devel etc…
  • 30. Config + deploy demo • LIVE DEMO
  • 31. Commit based deployment • What is my current version? • Bitbucket Provide a page where you can put your jenkins url. Committing will then trigger a build of a specific Job. https://drupal.org/sandbox/wouters_frederik/1979636
  • 32. I COMMITTED MY CODE It’s on dev, because it’s good
  • 33. WORKFLOW
  • 34. • Waterfall – Conception – Initiation – Analysis – Design – Construction – Testing – Implementation – Maintenance • Scrum – Agile – Sprint Backlog – 30 days sprint – Test – Release – Repeat • CI – Build test self – Commit to base – Build fast – Build + Test every commit Overview
  • 35. Advantages • Waterfall – Deliverables for every Phase – Complete 1 thing at a time • Scrum – Agile – Rapid delivery – Changes in requirements are ok – 30 days of awesome • CI – Early warnings of broken code – Immediate testing of all changes – Write less complex code (frequent checkins)
  • 36. Implementation • Waterfall – Work on master branch for entire project. • Scrum – Agile – Production branch – Hotfixes – Dev branch per Release of 30 days. • CI – Commit to master – Write code with feature toggles – Each change must be testeable / releasable
  • 37. How do the big fish do it? Facebook Moving fast and breaking things Major deploy every Tuesday Two minor deploys every day Conflicts are to be sold by Tuesday 12.00 Twitter Each feature/bugfix lives in its branch, branches are selected for deploy, tested and merged. This gives more merge conflicts. Google The release goes out on time. If a feature isn't ready, it just gets moved to the next release. Features that are not ready can be disabled (hidden) Everyone works most of the time on one main branch
  • 38. CI is hot Be sure to • Automate the build • Make your build self testing • Commit to the main line every day • Every commit should build to dev • Keep the build fast • Test a clone of production
  • 39. What worked for my bigger projects • Using jenkins • scrum • Working in sprint branches • Client tests --a lot--
  • 40. What works for you? • Small team, small changes, commit often, release often • Big Team, big Features… Consider a x days sprint and release branches. • …
  • 41. TL;DR Deploy without user interaction Find a workflow that suits your project Prepare for scaling
  • 42. Graphics http://nvie.com/posts/a-successful-git-branching-model/ Chuck Norris and friends
  • 43. Contact me @drupal_sensei wouters.f@gmail.co m