Advertisement
Advertisement

More Related Content

Similar to Trying Continuous Delivery - pyconjp 2012(20)

Advertisement
Advertisement

Trying Continuous Delivery - pyconjp 2012

  1. Trying'Con*nuous'Delivery Toru Furukawa! @torufurukawa!
  2. Keep service running
 before and after releasing
  3. Change,'Change,'Change
  4. Ship it as soon as it is ready
  5. Con*nuous'delivery #"Update"the"site"every"5"minutes" */5"*"*"*"*"cd"/www/example.com"" """"""""&&"git"pull"" """"""""&&"service"apache"restart" h5ps://speakerdeck.com/u/zeeg/p/prac*cing>con*nuous>deployment>disqus>pycon>2012
  6. Business value
  7. 5 Problems
  8. 1. Manual operation is 
 expensive and unpredictable
  9. Prefer'scripts'over'opera*ons $"make" env".............."build"dev"environment" unittest"........."run"unit"tests" acceptancetest"..."run"acceptance"tests" inspect".........."inspect"codes" deploy"..........."deploy"to"App"Engine"
  10. Automate'acceptance'tests
  11. Have'Jenkins'run'tests Deploy! Push! Notify! Pull! Write codes
 Unit tests Unit tests! Acceptance test!
  12. 2. Requirements will never be fixed
  13. Design product to ship incrementally
  14. Schema change class"User(Model):" class"User(Model):" ""name"="StringProperty()" ""name"="StringProperty()" ""birthday"=" ""birthday"=" """"DateProperty()" """"StringProperty()" ""email"=" """"StringProperty()"
  15. Add'new'property 1.  Add property with required=False! 2.  Deploy! 3.  Add app code to read and write new property! 4.  Update index! 5.  Deploy!
  16. Change property 1.  “Add” property with required=False! 2.  Deploy! 3.  Add app code to access old and new model! 4.  Update index! 5.  Deploy! 6.  Fill new property (if necessary)! 7.  Remove old property!
  17. class"User(Model):" ""name"="StringProperty()" ""birthday"="DateProperty()"
  18. class"User(Model):" ""name"="StringProperty()" ""date_birthday"=" """"DateProperty(name='birthday')" ""str_birthday"=" """"StringProperty(name='str_birthday’)"
  19. class"User(Model):" ""name"="StringProperty()" ""date_birthday"="…" ""str_birthday"="…" " ""def"get_birthday(self):" """"return"self.date_birthday" " ""def"set_birthday(self,"val):" """"self.date_birthday"="val" " ""birthday"="property(get_birthday," """"""""""""""""""""""set_birthday)"
  20. class"User(Model):" ""name"="StringProperty()" ""date_birthday"="…" ""str_birthday"="…" " ""def"get_birthday(self):" """"if"self.date_birthday:" """"""return"self.date_birthday.strftime(…)" """"else:" """"""return"self.str_birthday"
  21. class"User(Model):" ""name"="db.StringProperty()" ""date_birthday"="…" ""str_birthday"="…" " ""def"get_birthday(self):"…" " ""def"set_birthday(self,"val):" """"if"isinstance(val,"datetime.date):" """"""val"="val.strftime(…)" """"""self.date_birthday"="None" """"self.str_birthday"="val"
  22. class"User(Model):" ""name"="db.StringProperty()" ""date_birthday"="…" ""str_birthday"="…" " ""def"get_birthday(self):"…" " ""def"set_birthday(self,"val):"…" " ""birthday"="property(get_birthday," """"""""""""""""""""""set_birthday)"
  23. 3. Building and changing
 environment is expensive
  24. Google App Engine 
 lets us focus on app
  25. Make dev and production environments almost identical Production $ appcfg.py update –A myproduction src Server $ appcfg.py update src app.yaml Dev Server $ dev_appserver.py src Local dev server
  26. Have multiple versions deployed to switch code quickly $"appcfg.py"–V"v11"update"src" ..."(v11.myapp.appspot.com)" $"appcfg.py"–V"v11"set_default_version"src" ..."(myapp.appspot.com)" "
  27. 4. We still have problems
  28. Hg-flow for hotfix branches feature develop release hotfix master Deploy Deploy
  29. Rollback by changing default version $"appcfg.py"–V"v11"update"src" ..."(v11.myapp.appspot.com)" $"appcfg.py"–V"v11"set_default_version"src" " $"appcfg.py"–V"v10"set_default_version"src"
  30. 5. It does not happen overnight
  31. Start with what makes sense to you
  32. Allocate time for improvement
  33. TODOs •  Review! •  Faster feedback! •  Automate capacity tests! •  Manage libraries! •  Test client side app
  34. Things got better and are getting even better
  35. Share OUR experiences @torufurukawa! http://about.me/torufurukawa! http://facebook.com/toru.furukawa!
Advertisement