安裝
- idea插件離線版地址
https://plugins.jetbrains.com/plugin/7017-plantuml-integration/versions
自行下載與idea匹配的版本即可 - 安裝Graphviz組件(可選)
部分類型的圖會(huì)用到這個(gè)組件渲染,比如活動(dòng)圖
下載地址:https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi
下載完成后,點(diǎn)擊安裝笆凌,然后需配置安裝目錄下bin\dot.exe路徑到環(huán)境變量path即可
參考:
PlantUML離線使用:Intellij IDEA集成和jar包直接使用
使用
在idea中File->new->PlantUml選擇對(duì)應(yīng)類型的圖即可
語法參考:
PlantUML
列舉幾種常用示例:
-
1
@startuml
autonumber
hide footbox
title **Node 應(yīng)用研發(fā)部署流程**
actor "開發(fā)者" as user
participant "代碼倉庫(GitLab)" as gitlab
participant "持續(xù)集成系統(tǒng)" as ci
participant "運(yùn)維發(fā)布系統(tǒng)" as sys #orange
participant "服務(wù)器" as server
== 研發(fā)流程 ==
user -> gitlab: 提交代碼
activate user
deactivate user
activate gitlab
gitlab -> ci: 單元測(cè)試
deactivate gitlab
activate ci
note right of ci: tar 或 docker
ci -> ci: 打包
ci -> sys: 推送
note right of sys: 存儲(chǔ)到 oss
activate sys #orange
deactivate ci
deactivate sys
...
== 上線/回滾流程 ==
user -> sys: 選擇要上線的版本
activate sys #orange
activate user
deactivate user
sys -> server: 推送
activate server
note right of server: **無需--安裝依賴--雅任,快速且確定**
server -> server: 解壓
server -> server: 啟動(dòng)
server --> sys
@enduml
更多功能參考文章:
PlantUML-語雀