- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我们有一个构建服务器,旨在从 git 中 check out 一个版本的代码并构建它。通常服务器会 checkout 并构建 develop
分支,但它可以由 GUI 控制以执行任何特定分支或标记的构建。
我们的 git 存档很大,所以我们只想执行 git clone
一次。所以我的问题是:应该发出什么顺序的 git 命令,以使当前工作目录相对于远程 git 存档是最新的。
我最初天真的尝试只是执行了 git checkout <branch>
其次是 git pull
.但这并没有考虑到之前构建创建的所有需要删除的工件,以及构建过程中进行的一些自动代码修改,例如到程序集文件中的版本号。
所以我认为我们需要的是命令序列
请记住,指定的分支或标签在本地存储库中可能是未知的。例如,如果一个新的 release/xxx
分支是在远程服务器上创建的,这对于本地构建机器来说是先验的。这是我天真的方法偶然发现的另一个问题。
最后,git 服务器可能偶尔会更正它的历史记录。我确信这将是一个罕见的事件,但如果集成服务器在历史记录重写后不需要任何调整,那将是可取的。
非常感谢
最佳答案
这是我们目前使用的机制。 git clone
作为设置的一部分只执行一次,然后对每个构建执行以下操作。
为了清楚起见,我删除了错误处理。
# Undo any modifications made to the working tree by the build process
git reset --hard
# Remove any untracked build artifacts created by the build process
git clean -fdx
# Fetch all commits and new branches/tags from the git server.
git fetch
# Set the index and working directory to the required tag or branch.
# Notes:
# * If the last build was for the same branch, then this will not
# update the working directory.
# * The %TAG_OR_BRANCH% variable is passed in via the GUI. This will
# be in the form of a branch name (develop|release/vX.X.X) or a tag (vX.X.X)
git checkout %TAG_OR_BRANCH%
# Bring the index and working tree up-to-date.
# Notes:
# * the --ff-only flag is probably redundant, but we want to make it
# clear that no merging is expected.
git pull --ff-only
我们在开发人员机器上创建了新的标签/分支,将它们推送到服务器,这个脚本正确地获取它们并构建结果。我们尝试将 origin/
前缀添加到分支或标签名称,但这种方法对我们不起作用(无法识别标签名称)。
我认为这个脚本和@Yasser 建议的更简单的答案之间的主要区别是 git HEAD 指向正确的位置和命令 git status
给出了一个明智的答案。这是否重要 - 我不确定。
关于git - 如何在持续集成构建服务器上使用 git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37122520/
Windows 集成 (NTLM) 身份验证和 Windows 集成 (Kerberos) 之间有什么区别? 如何在IIS6中实现这些 w.r.t. MSDN 最佳答案 Kerberos 和 NTLM
Keycloak是一个用 Java 编写的开源身份验证和身份管理解决方案。它提供了一个nodejs适配器,使用它我能够成功地与express集成。这是有效的路由文件: 'use strict'
这是我关于 Bamboo 的第二个问题 ( My First One )。阅读建议信息后我的理解是,我需要一个构建工具,例如 nAnt 或 MSbuild 来编写一个获取源代码并构建它的脚本(我正在开
可用于将第三方应用程序与 jira 4.3 集成的身份验证方案有哪些?显然,从客户那里获取用户名和密码听起来很荒谬。另外,我知道 oauth 身份验证仅适用于版本 5。请告诉我。谢谢。 附注。我不是在
我有一个使用 DDS 的旧版 C++ 应用程序用于异步通信/消息传递。我需要将此应用程序集成到使用 JMS 进行消息传递的 JavaEE 环境中。除了构建独立的 JMS/DDS 桥接模块之外,我还有其
我正在尝试使用 Whatsapp 发送测试消息,但收到此错误消息: "error":{"code":27,"description":"Recipient not available on chann
我想将 photologue 与我的 Django 应用程序集成,并使用它在车辆库存中显示照片......有点像 Boost Motor Group Inc. 提供的内容。我已经集成了该应用程序,所以
我目前正在尝试弄清楚如何与 fujitsu scansnap 扫描仪集成,但没有从 fujitsu 找到有关 fujitsu scansnap 管理器如何调用您的应用程序并将文件发送到您的应用程序的详
在我的项目中,我使用了 9 个(九个)int-ip:udp-inbound-channel-adapter 和一个 jms:inbound-channel-adapter。 Jms 适配器从服务器接收
在我们当前的原型(prototype)中,大多数标准 HTML 控件都被小程序取代,最重要的是表单提交由小程序触发。 有没有一种方法可以像 一样在服务器端调用关联的操作 ? 本文Applet and
是否可以使用 twilio 号码从 whatsapp 发送/接收短信?有人用whatsapp试过twilio吗?我问过客服,如果可能的话,他说,不确定,但很多人都问过这个问题。 最佳答案 万一其他人来
我们办公室中几乎不存在版本控制,这显然导致了很多麻烦。我们想使用SVN和Notepad++进行设置...任何人都对如何实现此目标有任何想法?我已经开始研究并浏览了这个网站: http://www.sw
曾经有提供这种集成的 spring-modules 项目;但是,该项目现已弃用。现在有没有人继续支持这种集成?谢谢。 最佳答案 工作正在进行中。 http://blog.athico.com/sear
我的理解是,根据 http://wiki.dbpedia.org/Datasets,DBpedia 从 YAGO 获取类层次结构,而不是实体。 .但是,类似 http://dbpedia.org/cl
任何人都可以帮助我如何将 OpenCMS 与 Java Spring Web 应用程序集成。已经用谷歌搜索并浏览了很多网站但没有用。所以,请帮助我。 最佳答案 我认为将 SpringMVC 与 Ope
我正在尝试使用新的 migs getaway (MPGS) 我遵循了下一个 url 中的代码 https://ap-gateway.mastercard.com/api/documentation/i
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 4年前关闭。 Improve thi
我有一个 cmake 项目。我想轻松完成以下操作 搜索光标下任何变量、函数等的声明、定义和引用,这些可能在外部头文件中声明,其路径是在CMakeLists.txt中使用INCLUDE_DIRECTOR
有人能给我指点一下 Objective-C(或 c/c++)库的方向,或者教通过 FTP 上传或下载的教程(Objective-C)吗?最好能展示如何将文件下载到临时目录,然后稍后上传?我不介意针对
集成()给出了非常错误的答案: integrate(function (x) dnorm(x, -5, 0.07), -Inf, Inf, subdivisions = 10000L) # 2.127
我是一名优秀的程序员,十分优秀!