24
Con$nuous Delivery(CD) 継続的デリバリー @bae_j

[LT] Continuous Delivery

Embed Size (px)

DESCRIPTION

部署内のContinuous Deliveryの説明資料

Citation preview

Page 1: [LT] Continuous Delivery

Con$nuous  Delivery(CD)  継続的デリバリー  

@bae_j  

Page 2: [LT] Continuous Delivery

継続的デリバリーとは  Con$nuous  DeliveryとはリリースのスケジュールをIT部門が握るのではなく、ビジネス部門が握るということだ。 Con$nuous  Deliveryを実装するということは、全体のライフサイクルを通じて常にソフトウェアが本番環境にリリース可能であるということを意味する。すなわちどのビルドもボタン一発で、完全に自動化されたリリースプロセスを通じて、秒とか分の時間で利用者にリリース可能である、ということだ。  Jez  Humble  h=p://www.ryuzee.com/contents/blog/4241  

Page 3: [LT] Continuous Delivery

What  Is  Con$nuous  Delivery?  Crea$ng  a  $ght  feedback  loop  between  your  users  and  the  project  team—including  the  customer  or  product  owner—relies  in  turn  on  being  able  to  con$nuously  deliver  new  versions  of  your  soOware  to  test  changes  and  new  ideas,  and  being  able  to  measure  the  effect  of  these  changes  on  your  revenue.    For  many  companies  that  are  used  to  releasing  new  versions  of  soOware  at  most  every  few  months,  the  idea  of  releasing  changes  several  $mes  a  day  seems  impossible.  However,  at  ThoughtWorks,  we  have  used  the  principles  and  prac$ces  described  in  my  book  Con$nuous  Delivery  to  help  organiza$ons  that  released  a  few  $mes  a  year  move  to  releasing  several  $mes  a  month,  or  even  more  frequently.  That  represents  a  huge  compe$$ve  advantage,  and  it  means  a  large  reduc$on  in  the  amount  of  wasted  $me  and  effort  in  your  IT  organiza$on.    h=p://www.informit.com/ar$cles/ar$cle.aspx?p=1641923  

Page 4: [LT] Continuous Delivery

で、何だよ?  

•  ユーザのフィードバックを高速に回す  

• 儲かります  

• もう一度言います!儲かります!  

Page 5: [LT] Continuous Delivery

なぜ儲かるの?  

•  事業的には  – 事業の評価が速いから戦略修正も早い  – リスクが小さい  

•  IT部門には  – 実際の反応が得られる  – 個別リリースのリクス回避ができる  

Page 6: [LT] Continuous Delivery

まだまだのあなたのために  

h=p://www.ryuzee.com/contents/blog/4241  

Page 7: [LT] Continuous Delivery

まだまだのあなたのために2  

h=p://www.informit.com/ar$cles/ar$cle.aspx?p=1641923&seqNum=3  

Page 8: [LT] Continuous Delivery

CDはいいんだ!実践方法は?  

•  まずはこんなの読んでみましょう。  •  8  Principles  of  Con$nuous  Delivery  •  大丈夫日本語もあります。ここ  

Page 9: [LT] Continuous Delivery

8  PRINCIPLES  OF  CONTINUOUS  DELIVERY  

Page 10: [LT] Continuous Delivery

1.  The  process  for  releasing/deploying  soOware  MUST  be  repeatable  and  reliable.    

Page 11: [LT] Continuous Delivery

2.  Automate  everything!  

•  手動デプロイは犯罪!とは言ってないですが犯罪だと思います。  

•  自動化に本気で投資しろ!  

Page 12: [LT] Continuous Delivery

3.  If  somethings  difficult  or  painful,  do  it  more  oOen.  

•  馬鹿なこと言うな!じゃなくて辛い作業が改善へ導く  – キレたB氏の事例  

•  Antでビルドすると面倒いからMaven化  •  ビルドがあちこちでビルドされるからJenkinsでビルド

•  Deploy時間掛かるからFabricで時間を短くする  

Page 13: [LT] Continuous Delivery

4.  Keep  everything  in  source  control  

•  当たり前!  •  本当に?  – 本番のDBアクセスキーは?  

Page 14: [LT] Continuous Delivery

5.  Done  means  “released”.  

•  実装完了は完了ではない。  •  リリースされてユーザが実際に問題なく使う

時点から完了って言える。  •  Q.  うちではどうすればこれが言えるでしょう

か?  

Page 15: [LT] Continuous Delivery

6.  Build  quality  in!  

•  品質(quality  metrics)に投資しろ!  – Unit  test  coverage  – Code  style  check  – Rules  viola$on  – Complexity  measurement  

•  Sonar使いましょう  

Page 16: [LT] Continuous Delivery

7.  Everybody  has  responsibility  for  the  release  process.  

•  ローカル環境のあなたのアプリケーションは金にならない!  

•  リリースされてから価値は生まれる  •  その価値を生むためにPDM,  QA,  開発者の力

が必要且つ責任です。  

Page 17: [LT] Continuous Delivery

8.  Improve  con$nuously.  

•  引かない!  •  システムがメンテー不能になるまで待たな

い!  •  継続的改善でシステムをモダーンにする  

Page 18: [LT] Continuous Delivery

4  PRACTICES  OF  CONTINUOUS  DELIVERY  

Page 19: [LT] Continuous Delivery

1.  Build  binaries  only  once.    

•  各バージョンは一度だけビルドする。  – Maven  release  pluginが担保  – 各環境用の設定ファイルはどうする?  – wsdlは?  

Page 20: [LT] Continuous Delivery

2.  Use  precisely  the  same  mechanism  to  deploy  to  every  environment.    

•  当然の話ですが、STGと本番は同じ手順でデプロイする!  

Page 21: [LT] Continuous Delivery

3.  Smoke  test  your  deployment.    

•  B氏の事例  – Chefでmiddlewareをupdate  – 正常終了したのでアプリケーション再起動  – 45台のサーバの中1/3の確率でエラーを返す  – 1/3のサーバでmiddlewareはupdateされてない  – middlewareのpidチェックまたは機能確認手順がcookbookにあればよかった  

Page 22: [LT] Continuous Delivery

4.  If  anything  fails,  stop  the  line!  

•  途中で失敗したら全部止める  •  一旦ロールバック  •  最初から問題を解決してまたデプロイする  

Page 23: [LT] Continuous Delivery

B氏のCDは?  

•  面倒いから手で図書きます。  

Page 24: [LT] Continuous Delivery

Reference  

•  Con$nuous  delivery  – h=p://books.rakuten.co.jp/rb/11603145/  

•  h=p://www.informit.com/ar$cles/ar$cle.aspx?p=1641923  

•  h=p://www.informit.com/authors/bio/e0306367-­‐da75-­‐4f0f-­‐86a0-­‐14327a2ae568  

•  h=p://devlove-­‐kansai.doorkeeper.jp/events/10612  

•  h=p://www.ryuzee.com/contents/blog/