29 lines
1.5 KiB
Markdown
29 lines
1.5 KiB
Markdown
# GitHub——dastergon/postmortem-templates:postmortem 模板合集
|
||
|
||
- **期号**: SRE Weekly Issue #83(2017-07-30)
|
||
- **作者**: —
|
||
- **链接**: https://github.com/dastergon/postmortem-templates
|
||
|
||
## 简介
|
||
|
||
他还整理了这套来自各种来源的 postmortem 模板。他简直停不下来!
|
||
|
||
## 正文
|
||
|
||
这是一套取材于多个来源的 postmortem 模板合集,包括《[站点可靠性工程](https://landing.google.com/sre/)》(Site Reliability Engineering)一书、《[云系统管理实践](http://the-cloud-book.com/)》(The Practice of Cloud System Administration)一书以及其他在线资源。
|
||
|
||
你可以自动加载 postmortem 模板,而不必每次编写事故报告时都从文件中复制粘贴,或手动敲出模板结构。
|
||
|
||
你可以在 `.vimrc` 文件中加入下面这行:
|
||
|
||
```
|
||
au BufNewFile postmortem-*.md 0r ~/postmortem-templates/templates/postmortem-template-srebook.md
|
||
```
|
||
|
||
你可以在 `.emacs` 文件中加入下面这行:
|
||
|
||
```
|
||
(add-hook 'text-mode-hook (lambda () (when (and (string-prefix-p "postmortem-" (buffer-name)) (= (point-max) (point-min))) (insert-file-contents "~/postmortem-templates/templates/postmortem-template-srebook.md"))))
|
||
```
|
||
|
||
两种情况下,文件名模式都是 `postmortem-*`。例如,如果你创建一个名为 `postmortem-api-outage-2017-05-29.md` 的文件,预定义模板就会自动加载到该文件中。你可以替换 postmortem 模板和匹配模式,改成符合自己需求的内容。 |