确保部署正确版本的文件的最佳方法?

发布于 2024-07-07 23:34:14 字数 374 浏览 7 评论 0原文

我工作的公司编写了很多小型 Perl 和 Bash 脚本,将数据整理成可用于我们软件的内容。 这些脚本与任何代码一样可以更改。 我为他们提供 CVS 是因为文件版本控制而不是存储库版本控制。 不管怎样,我正在考虑一个部署工具来将脚本从开发到生产。 生产服务器将拥有自己的简单版本控制系统,如果其中一个脚本的 md5 和与数据库中的 md5 和不匹配,它将不会运行该脚本并向相应各方发送电子邮件。

我想强制程序员部署最新的 CVS 版本的脚本。 如果它不是最新的,它应该终止并显示一条消息,告诉他们必须首先检查他们的版本。 我意识到在某些情况下您可能需要部署旧文件。 这些都是例外情况,可以这样处理。

这样做最好是什么? 它就像执行“cvs diff”一样简单吗?

The company I work for writes a lot smallish Perl and Bash scripts to massage data into something usable for our software. These scripts, like any code, can change. I provided them CVS because of the file versioning rather than repository versioning. Anyway, I am thinking out a deploy tool to get the scripts from development to production. The production server will have it's own simple versioning system in that if one of the scripts' md5 sum does not match the one in a database it will not run the script and email the appropriate parties.

I want to force the programmers to deploy the most current CVS version of the script. If it is not the most current it should die with a message telling them they have to check in their version first. I realize there might be cases where you need to deploy an old file. Those would be exceptions and could be handled as such.

What's the best to do this? Is it just as simple as doing a 'cvs diff' ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笔芯 2024-07-14 23:34:14

如果您要编写某种分发脚本,它应该相对简单

1) 该脚本应该提交到您的 cvs 存储库中

2) 我建议从您的 makefile(或您使用的任何构建系统)调用该脚本
像这样的东西

make dist

和 dist 规则将调用你的脚本。
3) 脚本将执行

 cvs up -An 

并分析输出以查找 M 或 C 或 A 或 R 状态
例如,通过将输出重定向到 grep 。

grep -c ^[MCAR] 

如果计数> 0 你有问题。

4) 如果发现上述其中一项失败,则构建脚本失败

5) 如果不创建 tar 或您正在使用的任何其他形式的发行版

要部署旧版本,您可以将 -A 作为参数,默认设置为 -A 并覆盖,例如通过 shell 变量例如 -r tag-3.14.4 。

if you going to write some kind of distribution script it should be relatively simple

1) The script should be committed in your cvs repository

2) I advice to call the script from your makefile (or any build system you use)
something like this

make dist

and the dist rule will call your script.
3) script will perform

 cvs up -An 

and analyze the output to look for M or C or A or R status
by redirecting the output to grep for example.

grep -c ^[MCAR] 

if count > 0 you got a problem.

4) if one of above found fail the build script

5) if not create the tar or any other form of distribution you are using

To deploy older version you can make an -A as a parameter by default set to -A and overridden for example by shell variable to be for example -r tag-3.14.4 .

清风不识月 2024-07-14 23:34:14

我开发了一个进行部署的内部工具。
它是为企业设计的(并满足 SOX 法规),因此它依赖于批准来部署代码。

因此,我们部署了开发人员在请求中指定的代码版本,而不是最新版本。 原因是开发人员可能需要进行更改、进行测试,同时进行其他更改。 这些较新的更改尚未经过测试(QA)阶段,但开发人员的原始版本已经经过,因此我们将部署该版本。

话虽如此,我会以这样的方式设计它:可以指定版本号,如果没有版本号,则推送最新版本。

I worked on an internal tool that did deployments.
It was designed for the enterprise (and to meet SOX regulations), and so it relied on approvals to deploy code.

Because of this, we deployed the version of code the developer specified in the request, not the latest version. The reason is that a developer may need to make changes, place into test, meanwhile other changes take place. These newer changes have not gone through the test (QA) phases, but the developers original version has, so we would deploy that version.

All that to say, I would design it in such a way that a version number could be specified, and if no version number then push the latest.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文