仅更改文件的增量构建VSTS(Wordpress) [英] Incremental build VSTS for files changed only (Wordpress)

本文介绍了仅更改文件的增量构建VSTS(Wordpress)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于Wordpress php文件的构建和发布管道,但是我只想为在源代码管理中更改的文件创建一个构建.我没有使用Visual Studio Build任务,因为我猜这不适用于php文件.

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.

以下是管道的配置方式: 目前,在 build 下,我仅使用$(Build.SourcesDirectory)中的发布工件,而在 release 管道下,我正在使用FTP上传将这些工件复制到网站上.

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.

由于文件数量大于10K,所以

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.

我如何在内部版本中实现这一目标,因为该发行版将根据工件自动拾取文件.

推荐答案

VSTS中没有该功能可以根据以前的工件来拾取文件.

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. 创建XML文件,该文件存储每个文件的最新上载/发布信息(例如文件名,日期时间,更改集/提交版本).
  2. 创建一个PowerShell脚本文件,其中包含比较文件的逻辑(
  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

这篇关于仅更改文件的增量构建VSTS(Wordpress)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆