目前,我正在为 Azure DevOps 云和服务器实现扩展。 此扩展将添加管道任务。 当我测试这个扩展时,我遇到了一个问题。之后,我修复了问题并使用更新版本重新安装了扩展。
然后我发现新添加的文件没有反映。 有人可以帮忙吗?
我尝试编译任务并使用新版本重新安装。
{
"manifestVersion": 1,
"id": "dev",
"name": "test",
"version": "8.0",
"publisher": "coder",
"targets": [
{
"id": "Microsoft.VisualStudio.Services"
}
],
"description": "Manage your day-to-day work items, sprints, and releases in test",
"categories": [
"Azure Pipelines"
],
"icons": {
"default": "static/icon.png"
},
"content": {
"details": {
"path": "overview.md"
}
},
"files": [
{
"path": "Tasks/AddFeedStatusV1"
},
{
"path": "static",
"addressable": true
}
],
"contributions": [
{
"id": "service-endpoint",
"description": "Service endpoint type for devuser connections",
"type": "ms.vss-endpoint.service-endpoint-type",
"targets": [
"ms.vss-endpoint.endpoint-types"
],
"properties": {
"name": "devuser",
"displayName": "devuser server connection",
"url": {
"displayName": "Server Url",
"helpText": "Url for the devuser server to connect to."
},
"inputDescriptors": [
{
"id": "integ_scope_id",
"name": "integ_scope_id",
"description": "",
"inputMode": "textbox",
"isConfidential": false,
"validation": {
"isRequired": true,
"dataType": "string",
"maxLength": 300
}
},
{
"id": "conenction_function_uuid",
"name": "conenction_function_uuid",
"description": "",
"inputMode": "textbox",
"isConfidential": false,
"validation": {
"isRequired": true,
"dataType": "string",
"maxLength": 300
}
},
{
"id": "conenction_function_version",
"name": "conenction_function_version",
"description": "",
"inputMode": "textbox",
"isConfidential": false,
"validation": {
"isRequired": true,
"dataType": "string",
"maxLength": 300
}
},
{
"id": "app_install_id",
"name": "app_install_id",
"description": "",
"inputMode": "textbox",
"isConfidential": false,
"validation": {
"isRequired": true,
"dataType": "string",
"maxLength": 300
}
},
{
"id": "extension_id",
"name": "extension_id",
"description": "",
"inputMode": "textbox",
"isConfidential": false,
"validation": {
"isRequired": true,
"dataType": "string",
"maxLength": 300
}
}
],
"authenticationSchemes": [
{
"type": "ms.vss-endpoint.endpoint-auth-scheme-token"
}
],
"dataSources": [],
"helpMarkDown": "<a href=\"url-to-documentation\" target=\"_blank\"><b>Learn More</b></a>"
}
},
{
"id": "zs-addfeedstatus-task",
"type": "ms.vss-distributed-task.task",
"targets": [
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "Tasks/AddFeedStatusV1"
}
}
]
}
根据您的描述,
*.js
和*.js.map
文件位于AddFeedStatusV1
文件夹中,并且该文件夹已包含在vss-extension.json
中。
"files": [
{
"path": "Tasks/AddFeedStatusV1"
},
{
"path": "static",
"addressable": true
}
],
打包扩展时,更新的文件应包含在扩展中。
问题原因可能是任务版本没有更新,Azure DevOps不会更新任务配置文件。更新扩展的版本(在清单文件中)是不够的。
您可以尝试更新
task.json
文件中的任务版本。
例如:
任务.json
{
"$schema": "https://raw.githubusercontent.com/Microsoft/azure-pipelines-task-lib/master/tasks.schema.json",
"id": "a4234567-b49c-22d3-f456-526614176030",
"name": "xx",
"friendlyName": "xx",
"description": "xx",
"helpMarkDown": "",
"category": "Utility",
"author": "A",
"version": {
"Major": 0,
"Minor": 4,
"Patch": 0
},
.....
然后您可以再次打包扩展并安装新的扩展。
在这种情况下,您可以检查是否会反映更新的文件。