查看原文
其他

CI/CD Isn't Just About Efficiency -CI/CD 不仅关乎效率-简而言之,CI/CD应使我们快乐

image.png

DevOps principles, and CI/CD specifically, are generally presented as a way to more efficiently run a software development organization. While I hold the belief that CI/CD is more efficient and effective than manually testing and deploying code, I'd like to talk about something we don't bring up quite as often. Put simply, CI/CD makes us happy.

DevOps 原则,特别是 CI/CD,通常作为更高效地运行软件开发组织的一种方式。虽然我相信 CI_/CD 比_手动测试和部署代码更有效,但我想谈谈我们不经常提到的东西。简而言之,CI/CD_使我们感到高兴_。


Developer happiness matters 开发人员的幸福很重要

There are great resources out there that demonstrate the practical benefits of CI/CD. Fewer bugs, faster features, tighter release schedules, etc. If you're interested in that data, I'd recommend the book "Accelerate", but let's forget about all of that for a moment.

有很多资源可以证明 CI/CD 的实际好处。更少的错误,更快的功能,更紧凑的发布时间表等。如果你对这些数据感兴趣,我会推荐《加速》一书,但让我们暂时忘记所有这些。

Tech companies spend a lot of money to keep employees happy. Provided the budget exists, they set up ping-pong tables, buy soda machines, host meetups and hire baristas. All those perks are great, but if I'm ssh'ing onto a server multiple times each day to pull down new code and manually restart the back-end, I'm not a happy camper.

科技公司_花了很多_钱来让员工开心。只要有预算,他们就会摆放乒乓球桌,购买汽水机,举办聚会并聘请咖啡师。所有这些好处都很棒,但是如果我每天多次在服务器上ssh下拉新代码并手动重新启动后端,我就不是一个快乐的露营者。

Good engineers want to automate the boring stuff.优秀的工程师想要自动化无聊的东西。


People don't quit bad jobs, they quit bad developer experiences 人们不会放弃糟糕的工作,他们会放弃糟糕的开发人员体验

There's a saying 有句话说:

People don't quit bad jobs, they quit bad bosses人们不会放弃糟糕的工作,他们会放弃糟糕的老板

There's truth there of course, but I for one will quit a job, even if I do have a good boss, if I really hate the developer experience. Now, I'm also the kind of person that will go to great lengths to upgrade the developer experience before quitting, but sometimes there are simply too many roadblocks.

当然,这是有道理的,但我一个人会辞职,即使我_有一个_好老板,如果我_真的讨厌_开发人员的经历。现在,我也是那种在辞职之前会不遗余力地_升级_开发人员体验的人,但有时障碍太多了。

I really do not like doing manual tasks that can be easily automated. I do not like deploying code. I do like merging PRs. I do not like pulling down my coworker's 4-line PR so I can run go test. I do like seeing that the tests passed in the PR.

我_真的_不喜欢做可以轻松自动化的手动任务。我_不喜欢_部署代码。_我喜欢合并_ PR。我不喜欢拉下我同事的 4 行 PR,以便我可以运行go test._我喜欢看到_测试在 PR 中通过。

Is it worth it to set up automation? 设置自动化是否值得?

One of my favorite comics about automation is this classic XKCD. 我最喜欢的关于自动化的漫画之一是这个经典的XKCD

However, there is a problematic assumption that some people make in regards to automation. I do not think this is the right equation:

然而,有些人对自动化有一个有问题的假设。我不认为这是正确的等式:

should_automate = time_to_automate < time_for_task * num_tasks

The equation is far too practical. Humans are emotional creatures. I think there needs to me more leeway given to account for the fact that it's generally more enjoyable to write automation than to do a manual task over and over.

这个等式太实用了。人类是具有情感的。我认为我需要更多的回旋余地来解释这样一个事实,即编写自动化通常比一遍又一遍地执行手动任务更_令人愉快_。

For completely selfish reasons, I would rather spend 8 hours writing a script to move some data into a database than spend 6 hours manually copy and pasting. One of the tasks is soul-sucking, finger-numbing, painfully boring work. The other will probably be a bit of fun.

出于完全自私的原因,我宁愿花 8 个小时编写脚本将一些数据移动到数据库中,也不愿花 6 个小时手动复制和粘贴。其中一项任务是吸吮灵魂,麻木手指,_痛苦无聊的工作_。另一个可能会有点乐趣。

Perhaps a good analogy is, "In order to earn $100, would you rather spend 4 hours shovelling rock or 6 hours playing videogames?"

也许一个很好的类比是,“为了赚100美元,你愿意花4个小时铲石头还是花6个小时玩电子游戏?


The remaining manual tasks become more enjoyable  剩余的手动任务变得更加愉快

Imagine that a bug is reported, and you know exactly what the problem is. If you've got some nice automation pipelines set up, fixing the problem for your users is almost as easy as simply making the code change.

想象一下,报告了一个错误,并且您_确切地_知道问题是什么。如果您设置了一些不错的自动化管道,那么为用户解决问题_几乎与简单地_更改代码一样简单。

However, if you don't have any automation in place, it's an annoying pain in the ass. Changing the code still only takes 30 seconds, but you're now going to spend 15 minutes manually getting the new code running in production. You think, "Maybe this deployment can wait until the end of the day when we were going to deploy anyways."

但是,如果您没有任何自动化,那将是一个烦人的痛苦。更改代码仍然只需要 30 秒,但您现在需要花费 15 分钟手动让新代码在生产环境中运行。你会想,“也许这个部署可以等到我们无论如何都要部署的一天结束。

I guess what I'm saying is that I'm extraordinarily lazy, and I'm aware of it. I keep myself motivated and effective by making sure I like my job as much as possible. Automation isn't just about being more effective in an absolute sense; though it is that as well. Automation is also about being more effective by making my job more enjoyable so that I'm more motivated to do it.

我想我想说的是我_非常_懒惰,我知道这一点。我通过确保我尽可能喜欢我的工作来保持自己的积极性和效率。自动化不仅仅是在绝对意义上更有效;虽然_也是这样。_自动化也是为了让我的工作更愉快,这样我就有动力去做,从而提高效率。



What's your point? 你的观点是什么?

I'm not going to automate everything - I haven't thrown efficiency to the wind. However, I bias towards automating because I'm not a machine, I'm human, and I enjoy it.

我不会自动化一切——我没有把效率扔给风。然而,我偏向于自动化,因为我不是机器,我是人,我喜欢它。


Previous articles 往期推荐


什么是HELM?面向 Kubernetes 初学者的快速入门教程


用于应用开发的 CI/CD 与用于基础结构即代码的 CI/CD


如何将Secrets扫描加入到GitLab Pipeline


基础架构即代码 vs 配置管理 vs 基础架构预配


如何验证Kubernetes YAML Files


GitOps: Kubernetes CI/CD 的缺失环节


If this article is helpful to you, please forward it, like it and share it. Your attention is the driving force for my continuous efforts. Thanks for attention.

如果这篇文章对您有帮助,欢迎转发点赞分享。您的关注是我持续努力的动力。感谢关注。Hava a good day!

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存