DevOpsDay
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 那些年我們做過的 DevOps Pipeline - 陳正瑋(艦長) {%hackmd @DevOpsDay/BJXaW1_k6 %} ## 什麼是 CI/CD ? 不只是 Pipeline, Pipeline 是成果 CI 是一個整合的具體實踐,講的是團隊合作整合流程 ## CI: 持續整合 Continuous Integration 守護者:守護軟體品質 沒有自動化測試,不要說你是在做 CI! 可以在專案前期發現問題,低成本的好方法 ![](https://hackmd.io/_uploads/HyGHPnAkT.jpg) ## 開發人員應該遵守的 CI 七大要領 • Commit code frequently • Don't commit broken code • Fix broken builds immediately • Write automated developers tests • All tests and inspections must pass • Run private builds • Avoid getting broken code ## CD: 持續交付 Continuous Delivery 交付行為與部署脫離不了關係 任何人(環境)都可以取得(部署)任意版本的應用程式 *不只是 source code* ##### ==當然前提是如果有那個必要性與權限== - 持續交付 - 頻繁的整合與交付,任何的變動,都有可能造成意外 - 應該要有 CI/CD 守護最低限度的品質 - 透過 CI 及早的發現問題,避免惡性循環 - CI/CD 從頭跑到尾,要花多少時間才適當? ![](https://hackmd.io/_uploads/rJXq_hAJa.jpg) ## 持續交付的原則 - 建立可重複可靠的流程 - 盡可能的自動化 - 以版本控制管理並保護一切 - 越是棘手的事,越要儘早且頻繁處理 - 重視品質 - 交付是每位成員的責任 - 持續改善 - 2022 企業新興雷達圖 - Ref: https://www.ithome.com.tw/article/152583 ![](https://hackmd.io/_uploads/BksLc3Aya.png) --- ## CI/CD 工具歷史 - 第一代 CI/CD Pipeline - GUI => CI Server (Jenkins) => VM (Server) - 2008 Github - 2011 GitLab - 2011 CircleCI - 2011 Travis CI - 2016 Gitea ![](https://hackmd.io/_uploads/SJ02cnCya.png) - 第二代 CI/CD Pipeline - YAML -> VCS -> CI Server (GitLab CI) -> Pipeline --> CI Job on VM - Pipeline as code 可以用 code 管理 pipeline - 第 2.5 代 CI/CD Pipeline - 2015 K8s 宣告容器化的時代 - 透過 Docker 容器可以透過容器輕量化部署 runtime 環境 - 第 3 代 CI/CD Pipeline - 2018 Jenkins X - 2019 Argo CD - 2020 IaC - 2021 Pulumi v2.0.0 - 2021 Terraform - 透過 k8s 來建構部署 runtime 環境 ![](https://hackmd.io/_uploads/SJIpY-1xT.jpg) ## K8s 是新時代的 OS / Infra - 需要熟悉 linux 網路層才能理解其設計 ## 調整過多少次Pipeline? - 涉及: - 工具 - Jenkins => GitLab CI - 架構 - VM => Container - 流程 - 3 Stage => 5 Stage ## 好的程式架構是持續演化來的 - 組織架構、文化、流程、Tech Stack,DevOps Pipeline 也都要持續優化 - 軟硬整合、金融業等不同產業,這些因素是交錯而且複雜的,導致每個團隊做出來的 Pipeline 是不一樣的 ## Mindset ==跨職能跨部門的溝通協調無可避免== ` 全都是相依關係: 不給資源,只是在賭這個人什麼時候離職而已 不是一個人可以搞定的, 需要整個團隊共同配合 ` ### The Question behind the Question - 退後一步,了解全貌 - 人、流程、工具、資源限制,權衡多項變因的多重相依關係 - 找出關鍵 **瓶頸點**,安排超前 2-3 步的規劃 - 持續的溝通不能少 - 交付「價值」,避免落入無效的自動化,不要為了自動化而做自動化 - DevOps != CI/CD != 自動化 - 沒有做自動化測試,不要說你在做 CI/CD - code 任何異動都要經過 CI 的保護 --- CI/CD 是軟體品質守護者 異動需要經過 CI/CD 保護 ## CI/CD 的原則 - 建立可重複且可靠的流程 - 盡可能的自動化 - 以版本控制管理並保護一切 - 越是棘手的事,越要儘早且頻繁處理 - 重視品質 - 交付價值是每位成員的責任 - 持續改善 ## 個人心得 - 釐清是哪個世代的 Pipeline - 建立管理相依關係的原則 - 小處著手,持續迭代 ![](https://hackmd.io/_uploads/rJwVJpC1p.jpg) ![](https://hackmd.io/_uploads/rkXpk6A16.jpg) ## 聊天區 求投影片 🥲🥲 求求求投影片🥲🥲🥲

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully