Incremental build VSTS for files changed only (Wordpress)

巧了我就是萌 提交于 2019-12-07 13:47:44

问题


I have a build and release pipeline for Wordpress php files, but I only want to create a build for the files changed in source control. I am not using a Visual Studio Build task as this does not apply in case of php files I guess.

Here is how the pipeline is configured: Currently under the build I am using publish artifacts only from $(Build.SourcesDirectory) and under the release pipeline I am copying those artifacts to the website using FTP upload.

Since the amount of files is larger than 10K,

I want it to only build files that have changed and publish those instead of the whole directory again.

How do I achieve that within the build as the release will automatically pick files up based on the artifacts.


回答1:


There isn’t the feature in VSTS that can just pick files up based on the previous artifacts.

You can refer to these ways to achieve it:

  1. Create XML file that stores the last upload/publish information of each files (e.g. file name, date time, changeset/commit version).
  2. Create a PowerShell script file that included the logical to compare files (get files metadata and compare with that XML file) and copy updated files to specific folder
  3. Publish the files in that folder


来源:https://stackoverflow.com/questions/42910678/incremental-build-vsts-for-files-changed-only-wordpress

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!