快照和发布存储库的使用有何不同?

发布于 2024-12-20 14:48:56 字数 210 浏览 2 评论 0原文

据我所知,在开发过程中构建工件被放置在快照存储库中。

当产品需要进行 QA 测试时,团队是否从快照存储库中提取数据?或者他们是否进行完整的构建,部署到发布存储库,然后从那里将其交给 QA?

另外,如果我的快照存储库保存了每个构建的所有构建工件,那么通常如何清理它?我可以看到从构建服务器保留最后 5 个构建,但不是每个构建。如果有帮助的话我正在使用 Artifactory。

I understand that during development build artifacts are placed in the snapshot repository.

When a product needs to go to QA for testing, do teams pull from the snapshot repository? Or do they do a full build, deploy to the release repository, and then give it to QA from there?

Also, if my snapshots repository holds all the build artifacts from each build, how is this commonly cleaned up? I could see keeping the last 5 builds from the build server, but not every one. I'm using Artifactory if it helps.

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

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

发布评论

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

评论(1

走野 2024-12-27 14:48:56

意见不同,这是我的方法:

快照适用于开发

通常用于“一次性”构建。我从 CI 服务器发布它们,由对源代码所做的更改触发。快照构建的目的是共享特定团队最新的测试工件。这很重要,因为团队之间可能会共享 jar。

这种方法比我们之前共享源代码的方法要稳定得多(当另一个团队提交一些构建失败的东西时,就会出现持续的救火问题......以及其他人的扩展)。

清理快照

我使用 Nexus 来管理我的存储库,它有一个 计划任务 可以配置为定期清除快照存储库。我想 Artifactory 也有类似的功能。

候选版本用于 QA

我将 QA 视为向客户发布的完整版本。这就是为什么我更喜欢“发布候选者”这个词。

发布候选版本和快照之间的主要区别在于源代码是“标记的”或“标记的”(取决于您的 SCM 系统的术语)。您所做的就是在沙子上画一条线,您可以根据需要方便地重新创建二进制文件。

Nexus Professional 有一个暂存套件,这使得开发人员能够削减新版本并将其保存在临时“临时存储库”中。显然,某些版本将无法通过测试,在这种情况下它们将被丢弃。其他人要么晋升到链中的下一组,要么发布到公共区域。

有多种方法可以实现这种发布管理的“促销模型”。

如何管理版本修订

我的版本使用以下编号约定。

<major number>.<minor number>.<patch number>.<build number>

Example:
1.0.0.24

(对于较小/更简单的项目,我可能会改变约定并删除补丁号)。

Ivy 有一个非常有用的 buildnumber 任务来管理增量内部版本号,基于已发布到存储库的内容。

<property name="release.candidate" value="1.0.0"/>
..
<ivy:buildnumber organisation="${ivy.organisation}" module="${ivy.module}" revision="${release.candidate}"/>
..
<echo message="Release revision: ${ivy.new.revision}"/>

release.candidate 属性通常存储在版本控制下的属性文件中。我真正喜欢这个解决方案的是它支持并行分支管理(请参阅这个问题)。

Opinions differ, here'e my approach:

Snapshots are for Dev

Typically used for "throwaway" builds. I publish them from my CI server, triggered by changes committed to the source code. The purpose of the snapshot build is to share the latest tested artifact from a particular team. This is important as teams might be sharing jars between each other.

This approach is much more stable than our previous approach of sharing the source code (Constant fire-fighting problems, when another team commits something that fails their build.... and by extension everyone elses).

Cleaning up snapshots

I use Nexus to manage my repository, it has a scheduled task that can be configured to periodically purge the snapshot repository. I'd imagine Artifactory has similar functionality.

Release candidates are for QA

I treat QA like a full-blown release to the customer. That's why I prefer the term "Release Candidate".

The key difference between a release candidate build and a snapshot is that the source code is "tagged" or "labelled" (dependent on your SCM system's terminology). What you're doing is drawing a line in the sand from which you can conveniently re-create the binary on demand.

Nexus professional has a staging suite, which enables development to cut a new release and hold it on a temporary "staging repository". Obviously some releases will fail testing in which case they're dropped. others are either promoted to the next group in the chain, or released to the public area.

There are several methods of implementing this "promotional model" of release management.

How release revisions are managed

I use the following numbering convention for my releases.

<major number>.<minor number>.<patch number>.<build number>

Example:
1.0.0.24

(For smaller/simpler projects I might alter the convention and drop the patch number).

Ivy has a wonderfully useful buildnumber task to manage the incrementing build number, based on what has already been published to your repository.

<property name="release.candidate" value="1.0.0"/>
..
<ivy:buildnumber organisation="${ivy.organisation}" module="${ivy.module}" revision="${release.candidate}"/>
..
<echo message="Release revision: ${ivy.new.revision}"/>

The release.candidate property is typically stored in a properties file, under version control. What I really like about this solution is that it enables parallel branch management (See answer to this question).

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