仅更改文件的增量构建 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 脚本文件 (获取文件元数据 并与该 XML 文件进行比较)并将更新的文件复制到特定文件夹
  3. 发布该文件夹中的文件
  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天全站免登陆