Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

和艦長一起玩轉 GitLab & GitLab Workflow

1,737 views

Published on

最初對於許多人而言,GitLab 只是自建 Git Server 的其中一項選擇,但隨著其功能的日漸完善,如今 GitLab 已成為能夠幫助團隊快速建構軟體開發 Workflow 的其中一種解決方案。由 GitLab 公司提出的 GitLab Workflow,結合了 GitLab 一條龍的全套功能,試圖滿足軟體開發專案從開發至部署之各階段的需求。想更加認識 GitLab 與 GitLab Workflow 能玩出什麼花樣嗎?那就跟著艦長一起玩轉 GitLab 吧!

Published in: Software

和艦長一起玩轉 GitLab & GitLab Workflow

  1. 1. (2019 iThome 鐵⼈人賽 30 天內容集錦) Cheng Wei Chen @ STUDY4 TW .NET Conf 2019 和艦長⼀一起玩轉
 GitLab & GitLab Workflow
  2. 2. Cheng Wei Chen 陳 正瑋
 DevOps Taiwan Community & DevOpsDays Taipei Organizer 《Effective DevOps 中文版》譯者 《DevOps三十六計》繁中版審校者 http://chengweichen.com
  3. 3. https://devopsdays.twhttps://devopstw.club
  4. 4. 封⾯面
  5. 5. 封⾯面 GitLab
  6. 6. Agenda • 認識 GitLab • Workflow & GitLab Workflow • GitLab Flow • GitLab Auto DevOps • 回顧與總結
  7. 7. 認識 GitLab
  8. 8. 發展 VCS
  9. 9. 發展 VCS CI / CD
  10. 10. 發展 VCS CI / CD Project management DevOps
  11. 11. GitLab CI 圖片來來源 https://about.gitlab.com/product/continuous-integration/
  12. 12. GitLab Auto DevOps
  13. 13. 來來源 https://about.gitlab.com/
  14. 14. 來來源 https://about.gitlab.com/direction/
  15. 15. 名為 GitLab 的⼀一條龍 DevOps 平台 圖片來來源 https://about.gitlab.com/direction/
  16. 16. 來來源 https://docs.gitlab.com/ee/development/architecture.html GitLab Component diagram
  17. 17. GitLab Component • Component details • Alertmanager • Certificate management • Consul • Database migrations • Elasticsearch • Gitaly • GitLab Geo • GitLab Exporter • GitLab Pages • GitLab Runner • GitLab Shell • GitLab Workhorse • Grafana • Jaeger • Logrotate • Mattermost • MinIO • NGINX • Node Exporter • PgBouncer • PgBouncer Exporter • PostgreSQL • Postgres Exporter • Prometheus • Redis • Redis Exporter • Registry • Sentry • Sidekiq • Unicorn • LDAP Authentication • Outbound Email • Inbound Email • GitLab Managed Apps 來來源 https://docs.gitlab.com/ee/development/architecture.html
  18. 18. GitLab Geo 圖片來來源 https://docs.gitlab.com/ee/administration/geo/replication/index.html
  19. 19. GitLab Geo 圖片來來源 https://docs.gitlab.com/ee/administration/geo/replication/index.html
  20. 20. Omnibus 搞定安裝、設定
 GitLab 的⼤大⼩小事。
  21. 21. gitlab.com Self-Managed或 GitLab CE GitLab EE GitLab EE
  22. 22. Workflow & GitLab Workflow
  23. 23. Workflow / ⼯工作流程 Stage 1 Stage 2 Stage 3 Stage 3b Stage 4b Stage 5 Stage 3a Stage 3c Stage 4a Why?
  24. 24. Workflow / ⼯工作流程 Stage 1 Stage 2 Stage 3 Stage 3b Stage 4b Stage 5 Stage 3a Stage 3c Stage 4a Why? 標準化 ⾃自動化 透明化
  25. 25. 軟體開發⼯工作流程? 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/ Plan Code Test Release Deploy
  26. 26. GitLab Workflow 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/
  27. 27. GitLab Workflow: IDEA 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/ 每⼀一個天⾺馬⾏行行空的想法,都可能是產品創 意發想的起始點。 溝通 協作 互動 保存/回顧
  28. 28. Mattermost
  29. 29. GitLab Workflow: ISSUE 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/ 將 IDEA 轉換成實際的
 ISSUE / FEATURE / STORY 討論 追蹤 Issue Tracker
  30. 30. Issue Tracker
  31. 31. GitLab Workflow: PLAN 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/ 安排 ISSUE 的優先順序,
 分派⼯工作任務。 分派/追蹤 優先順序 Issue Board
  32. 32. Issue Board - To-Do
  33. 33. Issue Board - Workflow
  34. 34. Issue Board - By Member
  35. 35. GitLab Workflow: CODE 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/ 就是捲起袖⼦子開⼯工啦!
  36. 36. To-Do List
  37. 37. Milestones
  38. 38. Issue Tracker - Filtering issues by milestone 
  39. 39. 圖片來來源 https://docs.gitlab.com/ee/user/project/web_ide/ Web IDE
  40. 40. GitLab Workflow: COMMIT 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/ 遵守團隊的開發⼯工作原則與分⽀支策略略,將 程式碼送入版本控制系統。 分支策略 工作準則 Git Server GitLab Flow
  41. 41. GitLab Workflow: TEST 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/ 借助持續整合、⾃自動化測試,確保程式碼 的品質。 自動化 工作準則 GitLab CI
  42. 42. 圖片來來源 https://about.gitlab.com/product/continuous-integration/
  43. 43. GitLab Workflow: REVIEW 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/ Code Review & Merge branch 自動化 工作準則 Merge Request Issue Tracker
  44. 44. GitLab Workflow: STAGING 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/ ⾃自動部署⾄至 Staging 環境做進⼀一步的測試與 驗證。 持續部署 持續交付 GitLab CI GitLab Auto DevOps 自動化
  45. 45. GitLab Workflow: PRODUCTION 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/ 當⼀一切都驗證通過後,即可⾃自動部署⾄至 Production 環境,並事先預備 rollback 計畫。 持續部署 持續交付 GitLab CI GitLab Auto DevOps 自動化
  46. 46. GitLab Workflow: FEEDBACK 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/ 回顧與反思,產品及⼯工作流程分別有哪些 地⽅方需要改善。 監控 數據收集 報表 持續改善 Cycle Analytics Auto Monitoring
  47. 47. Cycle Analytics
  48. 48. CI/CD Charts
  49. 49. Burndown Chart
  50. 50. GitLab Flow
  51. 51. Git 分⽀支策略略? 圖片來來源 https://about.gitlab.com/blog/2014/09/29/gitlab-flow/ Git flow GitHub flow GitLab flow Trunk based
  52. 52. Git 分⽀支策略略? 圖片來來源 https://about.gitlab.com/blog/2014/09/29/gitlab-flow/ Git flow GitHub flow GitLab flow Trunk based Why?
  53. 53. GitLab Flow Git flow GitHub flow GitLab flow
  54. 54. GitLab Flow Git flow GitHub flow GitLab flowupsteam first for delivery
  55. 55. 圖片來來源 https://about.gitlab.com/blog/2014/09/29/gitlab-flow/ Production branch Environment branch 搭配持續交付、持續部署,明 確控管已部署之環境的程式碼 版本。
  56. 56. 圖片來來源 https://about.gitlab.com/blog/2014/09/29/gitlab-flow/ Release branch 依據 Stable 版本的發佈建立分 ⽀支,維持 Master 的穩定前進 並保留留能夠維護各 Stable 版本 的彈性。
  57. 57. GitLab Flow upsteam first for delivery
  58. 58. GitLab Auto DevOps
  59. 59. Kubernetes GitLab CI Auto DevOps Prometheus + =
  60. 60. Kubernetes GitLab CI Auto DevOps Prometheus + = 沒這麼 Auto 是有條件的
  61. 61. Auto DevOps • Auto Build • Auto Test • Auto Code Quality • Auto Static Application Security Testing (SAST) • Auto Dependency Scanning • Auto License Compliance • Auto Container Scanning • Auto Review Apps • Auto Dynamic Application Security Testing (DAST) • Auto Deploy • Auto Browser Performance Testing • Auto Monitoring K8S K8S K8S Prometheus
  62. 62. Auto DevOps • Auto Build • Auto Test • Auto Code Quality • Auto Static Application Security Testing (SAST) • Auto Dependency Scanning • Auto License Compliance • Auto Container Scanning • Auto Review Apps • Auto Dynamic Application Security Testing (DAST) • Auto Deploy • Auto Browser Performance Testing • Auto Monitoring K8S K8S K8S Prometheus CI / CD Pipeline Templates Cloud Native
  63. 63. 回顧與總結
  64. 64. 回顧 • 認識 GitLab • Workflow & GitLab Workflow • GitLab Flow • GitLab Auto DevOps
  65. 65. GitLab & DevOps 圖片來來源 https://about.gitlab.com/stages-devops-lifecycle/
  66. 66. 來來源 https://about.gitlab.com/
  67. 67. 軟體開發⼯工作流程? 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/ Plan Code Test Release Deploy
  68. 68. 軟體開發⼯工作流程? 圖片來來源 https://about.gitlab.com/blog/2016/10/25/gitlab-workflow-an-overview/ 產品開發 Plan Code Test Release Deploy ?
  69. 69. Workflow / ⼯工作流程 Stage 1 Stage 2 Stage 3 Stage 3b Stage 4b Stage 5 Stage 3a Stage 3c Stage 4a Why?
  70. 70. Git 分⽀支策略略? 圖片來來源 https://about.gitlab.com/blog/2014/09/29/gitlab-flow/ Git flow GitHub flow GitLab flow Trunk based Why?
  71. 71. Auto DevOps • Auto Build • Auto Test • Auto Code Quality • Auto Static Application Security Testing (SAST) • Auto Dependency Scanning • Auto License Compliance • Auto Container Scanning • Auto Review Apps • Auto Dynamic Application Security Testing (DAST) • Auto Deploy • Auto Browser Performance Testing • Auto Monitoring K8S K8S K8S Prometheus Why?
  72. 72. CI 持續整合 CD 持續交付 持續部署 Why?
  73. 73. 圖片來來源 https://about.gitlab.com/stages-devops-lifecycle/ Why?
  74. 74. 符合需求 學習成本 價格 售後服務 商業支援 生態系社群 設計邏輯 工具選擇策略 教學資源 複雜度 整合性 遷移性
  75. 75. 役物而不役於物
  76. 76. Manage Your Toolchain Before It Manages You 來來源 https://about.gitlab.com/resources/whitepaper-forrester-manage-your-toolchain/
  77. 77. Photo by Clark Tibbs on Unsplash Thank You
  78. 78. https://devopsdays.twhttps://devopstw.club
  79. 79. 謝謝

×