Add Ansible CD using github action to deploy project on staging vm#1123
Add Ansible CD using github action to deploy project on staging vm#1123changchaishi wants to merge 11 commits intopycontw:masterfrom
Conversation
22b0b95 to
4ad7f04
Compare
|
還沒有時間好好 review 但想要先開啟一個討論:在志工性質開發專案引入新的 tech stack (ansible here) 往往需要更謹慎(因志工普遍開發經驗較少、churn rate 也高,故維護成本希望越低越好),因此想丟幾個問題看看大家有沒有什麼意見
|
|
👌🏻
但由於目前手動部署的方式我自己也沒有太清楚,所以在 CD 上需要小心。目前只是驗證到可以把 codebase 搬過去,並且 build image (docker-compose up 因為會牽涉一些環境變數與靜態檔案,還沒寫進去)。等大大們評估後才看看怎麼實際導入。 補充:後來發現學習成本其實蠻重的,如果 ssh-action, 對自動化不熟的志工來說就比較淺顯易懂(跑指令),ansible 就比較旋了 (跑 module)。 |
|
那就再麻煩 @iknowright 協助補上有關部署、Ansible 使用操作相關的說明文件了,我們可以再下一次例會時討論那份文件,確認每個人可以 follow 文件進行操作,Thanks! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #1123 +/- ##
==========================================
- Coverage 70.80% 70.77% -0.03%
==========================================
Files 85 85
Lines 3381 3381
==========================================
- Hits 2394 2393 -1
- Misses 987 988 +1 ☔ View full report in Codecov by Sentry. |
0e5a1bb to
48cdb02
Compare
|
更新了,可以分為以下幾點:
|
There was a problem hiding this comment.
suggestion: Overall the document looks great to me. Thanks @iknowright!
Here are some suggestions. If you think they would be beneficial, please feel free to adopt them.
- Provide more context in the introduction. What is continuous deployment, and why is it important? How does it relate to the docker production deployment document mentioned?
- In the "Settings for Github Actions Workflow" section, consider adding a brief overview of what Github Actions and Ansible are, and how they are used for continuous deployment.
|
承如 Matt 所說,目前這個專案屬於志工維護性質,導入新的技術時需要審慎的考慮。 以目前的服務規模,似乎還沒有增加這個技術棧 (Ansible ) 需求 ,長期來看後面的組員也不見得有維護 Ansible 的經驗 建議改用 Github Action + SSH 的方式部署至 Instances 內。避免維護上增加未知的風險 詳細可參考此專案 google-github-actions |
|
Hi @tyuchx google-github-actions 其實跟 Ansible 是一樣後面都是 ssh,看起來 ssh-compute 這個套件是專門為 gcp 所設計,而 ansible 是不分平臺的。意思是這個 PR 也是 Github Action + SSH, 只是 SSH 是 ansible 而不是 ssh-compute。不過也蠻有道理 Ansible 要瞭解 playbook 的概念,ssh-compute 則是 script, 直覺上 ssh-compute 應該比較好上手? 主要是看大家是否可以掌握 CD 的精髓,而非後面工具的選擇,如果是選擇工具方面的話,我認爲 Ansible 是很好的選擇。如果要改成用 ssh-compute 我也可以協助。 |
Types of changes
Description
Add a github action to deploy project to staging VM using ansible
Ansible will do:
More Information
Please refer run action on https://github.com/iknowright/pycon.tw/actions/runs/4290521364/jobs/7474619726