[英]How do we create a list of files which have changed since the last deployment? Using Git
We are using TFS to deploy PDF files from a Git repository. 我们正在使用TFS从Git存储库部署PDF文件。
Deployments are tied to a specific branch. 部署绑定到特定分支。
Every so often it is decided that the branch contains good enough files to deploy. 经常会决定分支包含足够好的文件来进行部署。
We only want to deploy the files which have changed since the last deploy, not the entire branch. 我们只想部署自上次部署以来已更改的文件,而不是整个分支。 It is huge and takes too long to deploy the whole thing.
这是巨大的,并且部署整个事情花费的时间太长。
How can we tag the branch in a certain way when deployments happen and then when the next deployment is desired, compare the current branch to the tag and then deploy only the changes / differences / deltas? 当部署发生时,然后当需要进行下一个部署时,我们如何以某种方式标记分支,将当前分支与标记进行比较,然后仅部署更改/差异/增量?
Just to emphasize, this branch only contains PDF files, not code. 为了强调,此分支仅包含PDF文件,而不包含代码。 It does not need to be compiled.
不需要编译。
TO CLARIFY: 澄清:
On the build server, we want to avoid having to clone the entire repository every time the deployment process runs. 在构建服务器上,我们希望避免每次部署过程运行时都必须克隆整个存储库。 Usually, the first step in the deploy is to clone the repository, but this is taking too long.
通常,部署的第一步是克隆存储库,但这花了太长时间。 Is there a way to only pull down the files which have been added or modified?
有没有一种方法只能下拉已添加或修改的文件? Sparse checkout perhaps?
稀疏的结帐?
All the answer is in your question: 所有答案都在您的问题中:
git tag XYZ ${COMMIT_TO_TAG}
git tag XYZ ${COMMIT_TO_TAG}
git diff --name-status ${PREVIOUS_TAG}..${TAG_TO_DEPLOY}
git diff --name-status ${PREVIOUS_TAG}..${TAG_TO_DEPLOY}
To find the previous tag: 查找上一个标签:
git describe --first-parent --tags --abbrev=0 ${COMMIT_TO_TAG}
git describe --first-parent --tags --abbrev=0 ${COMMIT_TO_TAG}
git describe --first-parent --tags --abbrev=0 ${TAG_TO_DEPLOY}~1
git describe --first-parent --tags --abbrev=0 ${TAG_TO_DEPLOY}~1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.