trying continuous delivery - pyconjp 2012
TRANSCRIPT
![Page 1: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/1.jpg)
Trying'Con*nuous'Delivery�
Toru Furukawa!@torufurukawa!
![Page 2: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/2.jpg)
Keep service running before and after releasing�
![Page 3: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/3.jpg)
Change,'Change,'Change�
![Page 4: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/4.jpg)
Ship it as soon as it is ready�
![Page 5: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/5.jpg)
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�
![Page 6: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/6.jpg)
Business value�
![Page 7: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/7.jpg)
5 Problems�
![Page 8: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/8.jpg)
1. Manual operation is expensive and unpredictable�
![Page 9: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/9.jpg)
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"�
![Page 10: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/10.jpg)
Automate'acceptance'tests�
![Page 11: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/11.jpg)
Have'Jenkins'run'tests�
Push!
Acceptance test!Unit tests�Write codes
Unit tests!
Notify!
Pull!
Deploy!
![Page 12: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/12.jpg)
2. Requirements will never be fixed�
![Page 13: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/13.jpg)
Design product to ship incrementally�
![Page 14: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/14.jpg)
Schema change�
class"User(Model):"""name"="StringProperty()"""birthday"=\"""""DateProperty()"
class"User(Model):"""name"="StringProperty()"""birthday"=\"""""StringProperty()"""email"=\"""""StringProperty()"
![Page 15: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/15.jpg)
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!�
![Page 16: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/16.jpg)
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!
![Page 17: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/17.jpg)
class"User(Model):"""name"="StringProperty()"""birthday"="DateProperty()"
![Page 18: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/18.jpg)
class"User(Model):"""name"="StringProperty()"""date_birthday"=\"""""DateProperty(name='birthday')"""str_birthday"=\"""""StringProperty(name='str_birthday’)"
![Page 19: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/19.jpg)
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)"
![Page 20: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/20.jpg)
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"
![Page 21: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/21.jpg)
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"
![Page 22: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/22.jpg)
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)"
![Page 23: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/23.jpg)
3. Building and changing environment is expensive�
![Page 24: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/24.jpg)
Google App Engine lets us focus on app�
![Page 25: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/25.jpg)
Make dev and production environments almost identical�
app.yaml�
Local dev server�
$ dev_appserver.py src�
Dev Server�$ appcfg.py update src�
$ appcfg.py update –A myproduction src�Production
Server�
![Page 26: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/26.jpg)
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)""
![Page 27: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/27.jpg)
4. We still have problems�
![Page 28: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/28.jpg)
Hg-flow for hotfix branches�
develop�
master�
feature�
release� hotfix�
Deploy� Deploy�
![Page 29: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/29.jpg)
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"
![Page 30: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/30.jpg)
5. It does not happen overnight�
![Page 31: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/31.jpg)
Start with what makes sense to you�
![Page 32: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/32.jpg)
Allocate time for improvement�
![Page 33: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/33.jpg)
TODOs�• Review!• Faster feedback!• Automate capacity tests!• Manage libraries!• Test client side app�
![Page 34: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/34.jpg)
Things got better and are getting even better�
![Page 35: Trying Continuous Delivery - pyconjp 2012](https://reader035.vdocument.in/reader035/viewer/2022081403/554f8dedb4c9052a518b522c/html5/thumbnails/35.jpg)
Share OUR experiences�
@torufurukawa!http://about.me/torufurukawa!
http://facebook.com/toru.furukawa!