Octopus Deploy [3] Octopus Server 基礎設定

前言

本篇進行 Octopus Server 基礎設定、連線 Octopus Tentacle

建立 Project Group (Octopus Server)


建立 Projects (Octopus Server)

從藍框建立的 Project 會設為預設的Group
從紅框建立的 則歸屬在 Web Group底下



建立 Environments (Octopus Server)

建立 develop、qc 環境

Octopus 官方文件 - Guided failures
可啟用失敗引導 => 當佈署發生錯誤中斷時,可人工操作進行決策

  1. FAIL: mark the deployment as failed, don’t try anything else.
  2. RETRY: retry the step where the error occurred.
  3. IGNORE: skip the operation, but keep going with the deployment.
  4. EXCLUDE MACHINE FROM DEPLOYMENTS: exclude the deployment target from the rest of the deployment and proceed.

Octopus 官方文件 - Dynamic Infrastructure
可以透過 Octopus 的 API 動態創建 Octopus accounts, targets, and workers

建立 Deployment Targets (Octopus Server)

有支援多項服務,包括雲服務、Kubernetes
以佈署到 Windows 機器做範例,選擇 Listening Tentacles (官網推薦),其餘方式可參考 Octopus 官方文件 - Tentacle communication modes
Listening Tentacles 是在佈署機器上建立 TCP Port,以供 Octopus Deploy 佈署時連接

紅框需填入部署機器IP

先到下一篇設定部署機器 w4560000 - Octopus Deploy [4] Windows 機器 安裝 Octopus Tentacle

部署機器設定好後 填入部署機器IP

設定 develop機器 Listening Tentacle

待 develop、qc 都設定好後重新查看 Deployment Targets 是否正確連線

建立 Lifecycles

Lifecycle 用以限制部署的環境

Retention Policy 用以選擇永久保留或清除 releases 版本資料 和 packages 版本資料
若是跑在線上的服務 通常會設定清除固定時間的 releases 或 packages,不會讓資料無止盡增長 消耗 octopus Server 硬碟空間

新增 Phases

限定該Lifecycle 只能部署到 Develop

可選擇 有新建release版本則直接部署到環境機器上 以及 手動點擊release版本進行部署
需從產品維運角度來判斷,若是要固定時間部版,則選擇手動部署,若是隨時部署都無所謂的服務,可選擇自動部署

設定完成後 儲存

建立完成後 查看

目前限定 develop 只能部署到 develop環境, qc 則可以部署到 develop環境、qc環境

建立 Project Channel

建立 develop Channel,Lifecycle 選擇 develop (qc依此類推)

建立完成後 查看

目前該 Project 的 Channel 除了預設 Default之外,又多加了 develop、qc

結論

目前 Octopus Server & Octopus Client (develop、qc) 皆已設定完畢,接下來實作 部署 .Net Framework 網站至 IIS
w4560000 - ASP.NET MVC CI/CD 實作


轉載請註明來源,若有任何錯誤或表達不清楚的地方,歡迎在下方評論區留言,也可以來信至 leozheng0621@gmail.com
如果文章對您有幫助,歡迎斗內(donate),請我喝杯咖啡

斗內💰

×

歡迎斗內

github