From 976674a1fa7d73671e366b1680127c368639eb4f Mon Sep 17 00:00:00 2001 From: Gareth Emslie Date: Tue, 7 Jul 2020 15:22:32 +0200 Subject: [PATCH 1/7] updates --- .../DownloadArtifactsNexusV2/task.json | 2 +- .../DownloadArtifactsNexusV3/task.json | 2 +- vss-extension.json | 18 +++--------------- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2/task.json b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2/task.json index eee0a4b..5efaaf5 100644 --- a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2/task.json +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2/task.json @@ -17,7 +17,7 @@ "version": { "Major": 2, "Minor": 0, - "Patch": 47 + "Patch": 49 }, "minimumAgentVersion": "2.144.0", "instanceNameFormat": "Download Artifacts - Nexus Maven Repository v2", diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3/task.json b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3/task.json index 7eae1f9..be8228e 100644 --- a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3/task.json +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3/task.json @@ -17,7 +17,7 @@ "version": { "Major": 3, "Minor": 0, - "Patch": 48 + "Patch": 52 }, "minimumAgentVersion": "2.144.0", "instanceNameFormat": "Download Artifacts - Nexus Maven Repository v3", diff --git a/vss-extension.json b/vss-extension.json index 8fb7575..07d07f5 100644 --- a/vss-extension.json +++ b/vss-extension.json @@ -2,7 +2,7 @@ "manifestVersion": 1, "id": "nexus-custom-release-artifact-extension", "publisher": "soft-cor", - "version": "1.0.98", + "version": "1.0.105", "name": "Sonatype Nexus Repository Release Artifact", "description": "Add support for Sonatype Nexus Repository as an artifact for Release Pipelines", "public": true, @@ -406,14 +406,8 @@ } ], "taskInputMapping": { - "connection": "{{{connection}}}", "repository": "{{{definition}}}", - "group": "{{{group}}}", - "artifact": "{{{artifact}}}", - "baseVersion": "{{{version}}}", - "packaging": "{{{packaging}}}", - "classifier": "{{{classifier}}}", - "extension": "{{{extension}}}" + "baseVersion": "{{{version}}}" }, "dataSourceBindings": [ { @@ -696,14 +690,8 @@ } ], "taskInputMapping": { - "connection": "{{{connection}}}", "repository": "{{{definition}}}", - "group": "{{{group}}}", - "artifact": "{{{artifact}}}", - "baseVersion": "{{{version}}}", - "packaging": "{{{packaging}}}", - "classifier": "{{{classifier}}}", - "extension": "{{{extension}}}" + "baseVersion": "{{{version}}}" }, "dataSourceBindings": [ { From e0eda4dbdb19c94c4ea18b4ec76721990d2239d1 Mon Sep 17 00:00:00 2001 From: Gareth Emslie Date: Wed, 8 Jul 2020 12:52:01 +0200 Subject: [PATCH 2/7] add manifest for tfs 2018 --- package.json | 4 +- vss-extension-server-2018.json | 752 ++++++++++++++++++ ...tension.json => vss-extension-service.json | 2 +- 3 files changed, 756 insertions(+), 2 deletions(-) create mode 100644 vss-extension-server-2018.json rename vss-extension.json => vss-extension-service.json (99%) diff --git a/package.json b/package.json index 9b1c9e4..41c57ec 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,8 @@ "build": "tsc", "package:DownloadArtifactsNexusV2": "(for %f in (task.json,package.json,icon.png) do xcopy /y /i .\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV2\\%f .\\dist\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV2\\) && cd ./dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2 && npm install --only=production", "package:DownloadArtifactsNexusV3": "(for %f in (task.json,package.json,icon.png) do xcopy /y /i .\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV3\\%f .\\dist\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV3\\) && cd ./dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3 && npm install --only=production", - "package": "npm run build && npm run package:DownloadArtifactsNexusV2 && npm run package:DownloadArtifactsNexusV3 && tfx extension create --manifests vss-extension.json --output-path ./dist/" + "package:Server2018VSIX": "npm run build && npm run package:DownloadArtifactsNexusV2 && npm run package:DownloadArtifactsNexusV3 && tfx extension create --manifests vss-extension-server-2018.json --output-path ./dist/", + "package:ServiceVSIX": "npm run build && npm run package:DownloadArtifactsNexusV2 && npm run package:DownloadArtifactsNexusV3 && tfx extension create --manifests vss-extension-service.json --output-path ./dist/", + "package": "npm run package:Server2018VSIX && npm run package:ServiceVSIX" } } diff --git a/vss-extension-server-2018.json b/vss-extension-server-2018.json new file mode 100644 index 0000000..dc834be --- /dev/null +++ b/vss-extension-server-2018.json @@ -0,0 +1,752 @@ +{ + "manifestVersion": 1, + "id": "nexus-custom-release-artifact-server-2018-extension", + "publisher": "soft-cor", + "version": "1.0.106", + "name": "Sonatype Nexus Repository Release Artifact", + "description": "Add support for Sonatype Nexus Repository as an artifact for Release Pipelines", + "public": true, + "galleryFlags": [ + + ], + "categories": [ "Build and release" ], + "content": { + "details": { + "path": "overview.md" + }, + "license": { + "path": "LICENSE" + } + }, + "links": { + "support": { + "uri": "https://blog.soft-cor.com" + } + }, + "repository": { + "type": "git", + "uri": "https://github.com/keyoke/NexusPipelineArtifact" + }, + "badges": [ + { + "href": "https://dev.azure.com/softcores/NexusPipelineArtifact/_build?definitionId=2&_a=summary", + "uri": "https://dev.azure.com/softcores/NexusPipelineArtifact/_apis/build/status/keyoke.NexusPipelineArtifact?branchName=master", + "description": "Azure Pipeline for NexusPipelineArtifact" + } + ], + "tags": [ + "Sonatype", + "Nexus", + "repository", + "manager", + "continuous", + "release", + "deploy", + "cd" + ], + "targets": [ + { + "id": "Microsoft.VisualStudio.Services" + } + ], + "demands": [ + "api-version/3.0" + ], + "icons": { + "default": "icon-nexus-logo.png" + }, + "screenshots": [ + { + "path": "images/screen1.png" + }, + { + "path": "images/screen2.png" + }, + { + "path": "images/screen3.png" + }, + { + "path": "images/screen4.png" + }, + { + "path": "images/screen5.png" + } + ], + "files": [ + { + "path": "images/screen1.png", + "addressable": true + }, + { + "path": "images/screen2.png", + "addressable": true + }, + { + "path": "images/screen3.png", + "addressable": true + }, + { + "path": "images/screen4.png", + "addressable": true + }, + { + "path": "images/screen5.png", + "addressable": true + }, + { + "path": "icon-nexus-logo.png", + "addressable": true + }, + { + "path": "dist/Tasks/DownloadArtifactsNexus" + } + ], + "contributions": [ + { + "id": "nexus-endpoint-type", + "description": "Service connection type for Sonatype Nexus Repository", + "type": "ms.vss-endpoint.service-endpoint-type", + "targets": [ + "ms.vss-endpoint.endpoint-types" + ], + "properties": { + "name": "nexus", + "displayName": "Sonatype Nexus Repository", + "url": { + "displayName": "Repository URL" + }, + "authenticationSchemes": [ + { + "type": "ms.vss-endpoint.endpoint-auth-scheme-basic", + "inputDescriptors": [ + { + "id": "username", + "name": "Username", + "description": "Username for connecting to the endpoint", + "inputMode": "textbox", + "isConfidential": false, + "validation": { + "isRequired": true, + "dataType": "string" + } + }, + { + "id": "password", + "name": "Password", + "description": "Password for connecting to the endpoint", + "inputMode": "passwordBox", + "isConfidential": true, + "validation": { + "isRequired": true, + "dataType": "string" + } + } + ] + }, + { + "type": "ms.vss-endpoint.endpoint-auth-scheme-none" + } + ], + "inputDescriptors": [ + { + "id": "acceptUntrustedCerts", + "name": "Accept untrusted SSL certificates", + "description": "Allows self-signed SSL certificates.", + "inputMode": "checkbox", + "isConfidential": false, + "validation": { + "isRequired": false, + "dataType": "boolean" + } + } + ], + "dataSources": [ + + ] + }, + "constraints": [ + + ] + }, + { + "id": "nexus-build-release-task", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2" + } + }, + { + "id": "nexus-custom-release-artifact-type", + "description": "Sonatype Nexus Repository v2 Maven Artifact", + "type": "ms.vss-releaseartifact.release-artifact-type", + "targets": [ + "ms.vss-releaseartifact.artifact-types" + ], + "properties": { + "name": "nexus-maven-repository", + "displayName": "MavenRepoV2", + "endpointTypeId": "nexus", + "uniqueSourceIdentifier": "{{connection}}:{{repository}}:{{group}}:{{artifact}}", + "downloadTaskId": "a843bbfd-4ced-4e8d-8102-cf2f193ee283", + "artifactType": "Package", + "inputDescriptors": [ + { + "id": "connection", + "name": "Service connection", + "description": "Nexus service connection", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "repository", + "name": "Repository Id", + "description": "Name of the Nexus repository in which to look for the component.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "group", + "name": "Group Id", + "description": "The Maven groupId for a component.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection", + "repository" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "artifact", + "name": "Artifact Id", + "description": "The Maven artifactId for a component.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection", + "repository", + "group" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "defaultVersionType", + "name": "Default Version", + "description": "The default version will be deployed when new releases are created. The version can be changed for manually created releases at the time of release creation.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": false, + "values": { + "inputId": "defaultVersionTypeValues", + "defaultValue": "latestType", + "possibleValues": [ + { + "value": "latestType", + "displayValue": "Latest" + }, + { + "value": "specificVersionType", + "displayValue": "Specific version" + }, + { + "value": "selectDuringReleaseCreationType", + "displayValue": "Specify at the time of release creation" + } + ], + "isLimitedToPossibleValues": true + }, + "validation": { + "isRequired": true, + "dataType": "string" + } + }, + { + "id": "defaultVersionSpecific", + "name": "baseVersion", + "description": "The version of the component/asset.", + "inputMode": "combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection", + "repository", + "group", + "artifact", + "defaultVersionType" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + }, + "properties": { + "visibleRule": "defaultVersionType == specificVersionType" + } + }, + { + "id": "packaging", + "name": "Packaging", + "description": "The Maven packaging for a component, which is jar by default. Other values as used in Maven and other build tools are ear, war, maven-plugin, pom, ejb, zip, tar.gz, aar and many others.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": false, + "values": { + "defaultValue": "", + "possibleValues": [ + { + "value": "pom", + "displayValue": "pom" + }, + { + "value": "jar", + "displayValue": "jar" + }, + { + "value": "ejb", + "displayValue": "ejb" + }, + { + "value": "war", + "displayValue": "war" + }, + { + "value": "ear", + "displayValue": "ear" + }, + { + "value": "aar", + "displayValue": "aar" + }, + { + "value": "tar.gz", + "displayValue": "tar.gz" + }, + { + "value": "rar", + "displayValue": "rar" + }, + { + "value": "zip", + "displayValue": "zip" + }, + { + "value": "par", + "displayValue": "par" + }, + { + "value": "maven-archetype", + "displayValue": "maven-archetype" + }, + { + "value": "maven-plugin", + "displayValue": "maven-plugin" + } + ], + "isLimitedToPossibleValues": false + }, + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "classifier", + "name": "Classifier", + "description": "The Maven classifier for a component. Common values are javadoc, sources or tests.", + "inputMode": "textbox", + "isConfidential": false, + "hasDynamicValueInformation": false, + "validation": { + "isRequired": false, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "extension", + "name": "Extension", + "description": "The extension used for a specific asset of a component.", + "inputMode": "textbox", + "isConfidential": false, + "hasDynamicValueInformation": false, + "validation": { + "isRequired": false, + "dataType": "string", + "maxLength": 300 + } + } + ], + "taskInputMapping": { + + }, + "dataSourceBindings": [ + { + "target": "repository", + "endpointUrl":"{{{endpoint.url}}}service/local/all_repositories", + "resultSelector":"jsonpath:$.data[?(@.provider=='maven2')]", + "resultTemplate": "{ Value : \"{{{id}}}\", DisplayValue : \"{{{id}}}\" }" + }, + { + "target": "group", + "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{repository}}}&cn=maven", + "resultSelector":"jsonpath:$.data[*].groupId", + "resultTemplate": "{ Value : \"{{{defaultResultKey}}}\", DisplayValue : \"{{{defaultResultKey}}}\" }" + }, + { + "target": "artifact", + "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{repository}}}&g={{{group}}}", + "resultSelector":"jsonpath:$.data[*]", + "resultTemplate": "{ Value : \"{{{artifactId}}}\", DisplayValue : \"{{{artifactId}}}\" }" + }, + { + "target": "defaultVersionSpecific", + "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{repository}}}&g={{{group}}}&a={{{artifact}}}", + "resultSelector":"jsonpath:$.data[*]", + "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }" + }, + { + "target": "versions", + "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{repository}}}&g={{{group}}}&a={{{artifact}}}", + "resultSelector":"jsonpath:$.data[*]", + "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }" + }, + { + "target": "latestversion", + "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{repository}}}&g={{{group}}}&a={{{artifact}}}", + "resultSelector":"jsonpath:$.data[0]", + "resultTemplate": "{ Value : \"{{{latestRelease}}}\", DisplayValue : \"{{{latestRelease}}}\" }" + } + ], + "ArtifactTriggerConfiguration" : { + "isTriggerSupported": false + } + } + }, + { + "id": "nexus-build-release-task-v3", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3" + } + }, + { + "id": "nexus-custom-release-artifact-type-v3", + "description": "Sonatype Nexus Repository v3 Artifact (Maven)", + "type": "ms.vss-releaseartifact.release-artifact-type", + "targets": [ + "ms.vss-releaseartifact.artifact-types" + ], + "properties": { + "name": "nexus-maven-repository-v3", + "displayName": "MavenRepoV3", + "endpointTypeId": "nexus", + "uniqueSourceIdentifier": "{{connection}}:{{repository}}:{{group}}:{{artifact}}", + "downloadTaskId": "6a26339d-ca44-4f1c-8511-fde5b7550a68", + "artifactType": "Package", + "inputDescriptors": [ + { + "id": "connection", + "name": "Service connection", + "description": "Nexus service connection", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "repository", + "name": "Repository Id", + "description": "Name of the Nexus repository in which to look for the component.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "group", + "name": "Group Id", + "description": "The Maven groupId for a component.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection", + "repository" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "artifact", + "name": "Artifact Id", + "description": "The Maven artifactId for a component.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection", + "repository", + "group" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "defaultVersionType", + "name": "Default Version", + "description": "The default version will be deployed when new releases are created. The version can be changed for manually created releases at the time of release creation.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": false, + "values": { + "inputId": "defaultVersionTypeValues", + "defaultValue": "latestType", + "possibleValues": [ + { + "value": "latestType", + "displayValue": "Latest" + }, + { + "value": "specificVersionType", + "displayValue": "Specific version" + }, + { + "value": "selectDuringReleaseCreationType", + "displayValue": "Specify at the time of release creation" + } + ], + "isLimitedToPossibleValues": true + }, + "validation": { + "isRequired": true, + "dataType": "string" + } + }, + { + "id": "defaultVersionSpecific", + "name": "baseVersion", + "description": "The version of the component/asset.", + "inputMode": "combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection", + "repository", + "group", + "artifact", + "defaultVersionType" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + }, + "properties": { + "visibleRule": "defaultVersionType == specificVersionType" + } + }, + { + "id": "packaging", + "name": "Packaging", + "description": "The Maven packaging for a component, which is jar by default. Other values as used in Maven and other build tools are ear, war, maven-plugin, pom, ejb, zip, tar.gz, aar and many others.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": false, + "values": { + "defaultValue": "", + "possibleValues": [ + { + "value": "pom", + "displayValue": "pom" + }, + { + "value": "jar", + "displayValue": "jar" + }, + { + "value": "ejb", + "displayValue": "ejb" + }, + { + "value": "war", + "displayValue": "war" + }, + { + "value": "ear", + "displayValue": "ear" + }, + { + "value": "aar", + "displayValue": "aar" + }, + { + "value": "tar.gz", + "displayValue": "tar.gz" + }, + { + "value": "rar", + "displayValue": "rar" + }, + { + "value": "zip", + "displayValue": "zip" + }, + { + "value": "par", + "displayValue": "par" + }, + { + "value": "maven-archetype", + "displayValue": "maven-archetype" + }, + { + "value": "maven-plugin", + "displayValue": "maven-plugin" + } + ], + "isLimitedToPossibleValues": false + }, + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "classifier", + "name": "Classifier", + "description": "The Maven classifier for a component. Common values are javadoc, sources or tests.", + "inputMode": "textbox", + "isConfidential": false, + "hasDynamicValueInformation": false, + "validation": { + "isRequired": false, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "extension", + "name": "Extension", + "description": "The extension used for a specific asset of a component.", + "inputMode": "textbox", + "isConfidential": false, + "hasDynamicValueInformation": false, + "validation": { + "isRequired": false, + "dataType": "string", + "maxLength": 300 + } + } + ], + "taskInputMapping": { + + }, + "dataSourceBindings": [ + { + "target": "repository", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/repositories", + "resultSelector":"jsonpath:$.[?(@.format=='maven2')]", + "resultTemplate": "{ Value : \"{{{name}}}\", DisplayValue : \"{{{name}}}\" }" + }, + { + "target": "group", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{repository}}}{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", + "resultSelector":"jsonpath:$.items[*].group", + "resultTemplate": "{ Value : \"{{{defaultResultKey}}}\", DisplayValue : \"{{{defaultResultKey}}}\" }", + "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", + "callbackRequiredTemplate": "{{#equals continuationToken null}}false{{else}}true{{/equals}}", + "initialContextTemplate":"{\"continuationToken\" : null}" + }, + { + "target": "artifact", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{repository}}}&maven.groupId={{{group}}}{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", + "resultSelector":"jsonpath:$.items[*]", + "resultTemplate": "{ Value : \"{{{name}}}\", DisplayValue : \"{{{name}}}\" }", + "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", + "callbackRequiredTemplate": "{{#notEquals continuationToken null}}true{{/notEquals}}", + "initialContextTemplate":"{\"continuationToken\" : null}" + }, + { + "target": "defaultVersionSpecific", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{repository}}}&maven.groupId={{{group}}}&maven.artifactId={{{artifact}}}&sort=version{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", + "resultSelector":"jsonpath:$.items[*]", + "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }", + "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", + "callbackRequiredTemplate": "{{#notEquals continuationToken null}}true{{/notEquals}}", + "initialContextTemplate":"{\"continuationToken\" : null}" + }, + { + "target": "versions", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{repository}}}&maven.groupId={{{group}}}&maven.artifactId={{{artifact}}}&sort=version{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", + "resultSelector":"jsonpath:$.items[*]", + "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }", + "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", + "callbackRequiredTemplate": "{{#notEquals continuationToken null}}true{{/notEquals}}", + "initialContextTemplate":"{\"continuationToken\" : null}" + }, + { + "target": "latestversion", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{repository}}}&maven.groupId={{{group}}}&maven.artifactId={{{artifact}}}&sort=version", + "resultSelector":"jsonpath:$.items[0]", + "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }" + } + ], + "ArtifactTriggerConfiguration" : { + "isTriggerSupported": false + } + } + } + ], + "scopes": [], + "contributionTypes": [] +} \ No newline at end of file diff --git a/vss-extension.json b/vss-extension-service.json similarity index 99% rename from vss-extension.json rename to vss-extension-service.json index 07d07f5..21ee555 100644 --- a/vss-extension.json +++ b/vss-extension-service.json @@ -2,7 +2,7 @@ "manifestVersion": 1, "id": "nexus-custom-release-artifact-extension", "publisher": "soft-cor", - "version": "1.0.105", + "version": "1.0.106", "name": "Sonatype Nexus Repository Release Artifact", "description": "Add support for Sonatype Nexus Repository as an artifact for Release Pipelines", "public": true, From 16e22870063104a6f3192b658d15f0263cb874a3 Mon Sep 17 00:00:00 2001 From: Gareth Emslie Date: Wed, 8 Jul 2020 13:13:45 +0200 Subject: [PATCH 3/7] update tasks --- .../DownloadArtifactsNexusV0_2/IhttpHelper.ts | 6 + .../DownloadArtifactsNexusV0_2/httpHelper.ts | 135 ++++ .../DownloadArtifactsNexusV0_2/icon.png | Bin 0 -> 4431 bytes .../DownloadArtifactsNexusV0_2/index.ts | 165 ++++ .../package-lock.json | 508 ++++++++++++ .../DownloadArtifactsNexusV0_2/package.json | 21 + .../DownloadArtifactsNexusV0_2/task.json | 206 +++++ .../DownloadArtifactsNexusV0_3/IhttpHelper.ts | 6 + .../DownloadArtifactsNexusV0_3/httpHelper.ts | 138 ++++ .../DownloadArtifactsNexusV0_3/icon.png | Bin 0 -> 4431 bytes .../DownloadArtifactsNexusV0_3/index.ts | 169 ++++ .../package-lock.json | 508 ++++++++++++ .../DownloadArtifactsNexusV0_3/package.json | 21 + .../DownloadArtifactsNexusV0_3/task.json | 215 +++++ package.json | 6 +- vss-extension-server-2018.json | 752 ------------------ ...tension-service.json => vss-extension.json | 28 +- 17 files changed, 2125 insertions(+), 759 deletions(-) create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/IhttpHelper.ts create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/httpHelper.ts create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/icon.png create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/index.ts create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/package-lock.json create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/package.json create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/task.json create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/IhttpHelper.ts create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/httpHelper.ts create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/icon.png create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/index.ts create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/package-lock.json create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/package.json create mode 100644 Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/task.json delete mode 100644 vss-extension-server-2018.json rename vss-extension-service.json => vss-extension.json (97%) diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/IhttpHelper.ts b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/IhttpHelper.ts new file mode 100644 index 0000000..9885bd2 --- /dev/null +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/IhttpHelper.ts @@ -0,0 +1,6 @@ +export interface IhttpHelper { + execute_http(searchUri : URL) : Promise; + execute_http(searchUri : URL, username? : string, password? : string) : Promise; + execute_https(searchUri : URL, acceptUntrustedCerts : boolean) : Promise; + execute_https(searchUri : URL, acceptUntrustedCerts : boolean, username? : string, password? : string) : Promise +}; \ No newline at end of file diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/httpHelper.ts b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/httpHelper.ts new file mode 100644 index 0000000..ed2f195 --- /dev/null +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/httpHelper.ts @@ -0,0 +1,135 @@ +import tl = require('azure-pipelines-task-lib/task'); +import path = require("path"); +import fs = require('fs'); +import http = require('http'); +import https = require('https'); +import { IhttpHelper } from './IhttpHelper'; + +export class httpHelper implements IhttpHelper { + public async execute_http(searchUri : URL) : Promise; + public async execute_http(searchUri : URL, username? : string, password? : string) : Promise + { + tl.debug(`execute_http.`); + + let options : http.RequestOptions = { + host: searchUri.hostname, + path: `${searchUri.pathname}?${searchUri.searchParams}`, + method: 'GET', + headers: { + 'Accept': 'application/xml' + } + }; + + if(username && + password) + { + const authBase64 : string = Buffer.from(username + ':' + password).toString('base64'); + + // Make sure the secret is correctly scrubbed from any logs + tl.setSecret(authBase64); + options.headers['Authorization'] = 'Basic ' + authBase64; + } + + // Setup new agent dont use the global one + options.agent = new http.Agent(); + options.port = searchUri.port || options.defaultPort; + + // execute the http request + await this.execute_request(http, options); + } + + public async execute_https(searchUri : URL, acceptUntrustedCerts : boolean) : Promise; + public async execute_https(searchUri : URL, acceptUntrustedCerts : boolean, username? : string, password? : string) : Promise + { + tl.debug(`execute_https.`); + + let options : https.RequestOptions = { + host: searchUri.hostname, + path: `${searchUri.pathname}?${searchUri.searchParams}`, + method: 'GET', + rejectUnauthorized: !acceptUntrustedCerts, // By default ensure we validate SSL certificates + headers: { + 'Accept': 'application/xml' + } + }; + + if(username && + password) + { + const authBase64 : string = Buffer.from(username + ':' + password).toString('base64'); + + // Make sure the secret is correctly scrubbed from any logs + tl.setSecret(authBase64); + options.headers['Authorization'] = 'Basic ' + authBase64; + } + + // Setup new agent dont use the global one + options.agent = new https.Agent(); + options.port = searchUri.port || options.defaultPort; + + // execute the https request + await this.execute_request(https, options); + } + + private async execute_request(client : any, options : http.RequestOptions | https.RequestOptions) : Promise + { + tl.debug(`HTTP Request Options: ${JSON.stringify(options)}.`); + + return new Promise((resolve, reject) => { + let req : http.ClientRequest = client.request(options, function(res : http.IncomingMessage) { + tl.debug(`HTTP Response Status Code: ${res.statusCode}.`); + tl.debug(`HTTP Response Status Message: ${res.statusMessage}.`); + tl.debug(`HTTP Response Headers: ${JSON.stringify(res.headers)}.`); + + if (res.statusCode == 301 || res.statusCode == 307) { + const downloadUri : URL = new URL(res.headers.location); + + // Set correct options for the new request to download our file + options.host = downloadUri.hostname; + options.path = downloadUri.pathname; + options.port = downloadUri.port || options.defaultPort; + + console.log(`Download asset using '${downloadUri}'.`); + let filename : string = path.basename(downloadUri.pathname); + console.log(`Download filename '${filename}'`); + + let inner_req : http.ClientRequest = client.request(options, function(inner_res : http.IncomingMessage) { + tl.debug(`HTTP Response Status Code: ${inner_res.statusCode}.`); + tl.debug(`HTTP Response Status Message: ${inner_res.statusMessage}.`); + tl.debug(`HTTP Response Headers: ${JSON.stringify(inner_res.headers)}.`); + + if(inner_res.statusCode == 200) + { + const file : fs.WriteStream = fs.createWriteStream(filename); + inner_res.on('data', function(chunk : any){ + file.write(chunk); + }).on('end', function(){ + file.end(); + }); + console.log(`##vso[task.setvariable variable=MAVEN_REPOSITORY_ASSET_FILENAME;isSecret=false;isOutput=true;]${filename}`) + console.log(`Successfully downloaded asset '${filename}' using '${downloadUri}'.`); + resolve(); + } else + { + console.log(`Asset download was not successful!`); + reject(`Asset download was not successful!`); + } + }); + inner_req.end(); + }else + { + tl.debug(`Asset search was not successful!`); + let message : string = `Asset search was not successful!`; + if (res.statusCode == 401) { + message = `Invalid Nexus Repo Manager credentials!`; + } else if (res.statusCode == 404) { + message = `Asset does not exist for search, or invalid Nexus Repo Manager Url!`; + } + console.log(message); + reject(message); + } + }); + req.end(); + }); + } +} \ No newline at end of file diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/icon.png b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c6261b14f93f25949a4933c6d6ba47f316c63c83 GIT binary patch literal 4431 zcma)AXHXMNyA3V$4uYXc2bCs*1|d`lyeh>4VyM!4=)D>U9i&$QQ9&u8h;$NqlTZR7 zC{21%2)$~q?|k2VuiwnQGxwP}`^>ZZYxkVz%*4Pl{x@iV zzsD|!)zI%m=JgP&0jR?AZu~AN?bRQs0{}J2^cPlCziV2!j)@llz|{3O$okyNYybe3 zWnC@x$NuI&%p4O$pKw-f77Q$W)_EE&D$M%)aVAS(q~Ri)VM%zeXm1!>$9-ldr|z)s zLux0DPUaY#>tbY_2)7>_O(PFmHP0|WKAfG56B>2jF7VQN+eN$APLoghW_#$)@IlZl z>MV3}ZO*HGX9jlo!ELhK7}adf#`;Ipyh{0^6!XJ+iRWc4Skp*BE={!rqr1;A{@!6R zr#VNO=9CZLw&J;wIGU$4O_A2(S6x+<3Qm`4~F!jJ2$I}~^>uYUY`ogQ(vx4f!#=BMQU$d*e>V67dE~cMA z8zRI{uiE(#R|EhipJ=bG7xXWwX?U_Kvp&Xde4i>Wz~*eiMV?Iz?-|;=`FW>jG`rM~ z<7{YF>KSNBG(;zkyo7nN(U#9@#a@p-78#G-4GAG@@o)Ay$I^nE{3rnD%h#TY+Vz=Y zv%eLLs_#T+y7)vj79KYAE5CF%L4e; z{Q>TvTv8E|$0KhxD2SuZ#YYYvmLAGegC34Swjz?Qgv+owf(X$k5S+I z%%L5+Rn-W!R=$$;)aTT-pOoX68uyfg3w9c8KUPq*qt-vRLomjn5a3`t#iL^t^-fjt zR=OjxX;@Q8txgYAnu!WvI;nMO{Zr|Um|=4btb91C?%kPT!cXIcQ;I8h zqFcoY+PO_2K7!iSR0L65=3`C%PQ#lt>!f8LeXgfyOCz>)h1?8E+eAB2b(0bkT?4$s zpHqfQ_2H`e+lnO6DiDBh{66Vt?fu!4dPS$B4=A@?vx&UDw03H%*?}fs`J0D%3GKm66y5Hp1wP7JvZlZZ<4MJF*0Wl6`(DU}Chmo3t!fB940U=-w{G+S`4{ zN%I!CcVg$2p3w2n*4&NOD+hPGM}*l<)&Oe0G+$%6=-Qdi8yvf0Q`5sM<+2l^2NEuI zu`9Yk*K9m3dFwj~e{-rVy%)!i4`5&Kdde)&H`r+J=@+Vdn}A!##;Vi6Jo+2izUAbK zY%vmfB)Q1lT9?E{8d8|izsZG;J#=P>MpZL9#B?qeWELV!QrRv_BjI@QjdQbETYCCzDN zLg%?_B0u2{MLrn~C^%Mn$RtkWzk_Q<`h-&5WIPsRY3MjoXqDs$`X#B;dU<=epWqTW zwLR=wyaapPj%-Kz8-VzRBew|0m6~Nn5w`iWP6DW81 z0#s*4N>=QuxP6P}7j%($%1$0L`*+QxM2jIM@T!jav3JBF{r}GRKO)G^mN|dOokX6~ zw$wtLd*#|q)5MPzn^wQ=w7`M3#tyF~6s~14QjzHL-6gL62S66$yzd`WrBX~9CaXrWl`KWHZ`Y^>dSp~3?A(q59WTt- zTbHc3nlzMNLxE?Uo48<|DKmVmmq)MD4^NqMs zah*wn`B>Z%k!`Ih=ydwFkc3a3*;e*jV(K|!q%g-BcsRh$-;w&?iNg7%*!ro61DCeef(Y7~TYv|}5Xt2PAfTb+2 zd3K(h5XO|+Em&3{BIr(nA4NPCOBXAO@GgXH1=1)?oOT=h5}J9i?T#jxHCTyA@)Xl!>e1Ae`M>9mh zslA?lk4GcbhQ8a+y8BHAKD2VQn9AIA^HtN!sSj?&p$*>sKs@W*%le7agDmDR!l4iV z+_RcWsPNKNOXzb6)5=g?uA(C^smWUDc8`|w@|w{MN_3G)m6#G*d@ioUa$~9sw`@xg zVop|M;;9eU8{gOr!r!-0*v~3$b+N12D%-bKTbb%gwoJb$&R=EJ;oc?cRC(!V-ZDX#SDr|P@$HNb9QeU?3D1lekQVa1L5<@zG$Q4ibg+(CIF_{{d>KPR6tZYWcTi+?yG=wssz8*ZkU$6qhmK15T$eZa55B*H;f?;h9qr zGO96c7+4_E2yl!g8wv*~$6nD$tXMX{I=(}JE~vmwoNZ!0E_DoF-T8UuZ~SqA-s0(C z<~%v+3sc~Y_7}W?rFhb4Ibm3F1eNS@lIi$iV~qI7%KTq%V)*V2Wm`E#&j#f%ENO8guHnp*q zDSk0;2I}Fb=_yhgRn%~W#(IOus?TTZHoqv(0YHou+jd(UI?U2KQ*2&sTl9P;dp3T8UF?^s=Xol~(RTZ(y#uE6{0x@I} zF^@#puiD%DQ%V$#RxvOj(n+Qmdwsfy+Ezi%W|qGk<6h@T6WKM^5pLjd?*~@aqCqC5 zd15B5;h4F&1nq`{cuGaWUqUsz7W}{?ZgW(~E{FJmTBSx+}p9 z+fS;!tY%vzZ$7^pA@%FVCsFrbCz9WbPp5MNSg+Gj0D@G)C=vQ8%@n?@l6#(p5qcE= z_+zrIiRZ0G7+hpQQ;5=SgrArH8)tj`%L7*tvpA*;R2;o!Uw#C0;kDtXqe=W4rH3p= zK{-ZG1tQJpzK%|*68qlvP=VP_cyja;zeH)z?7#KsG3d9ogu#pxXif!_i1l>Hf6@Dg zQO2?8m!aegg$t5nTF4H4*#jv6!nX2p<%atnHQt{CU~P zKUL3ozRvFKLk?Pb#a2Gv3>reqiPZWgwIKUl6+gmw7q0dG-*#8QNtGBa^wjU3jPoY$ z`?C)jZXfJ-J*xML`nzr`UN9UAeTjnV_Zw6jaoqg3t+IZIWtnH4^`t^qDTN6u-3v`H z`2D!+%vVL86TOrM?8q=NAccID0~5y96VxZhD>nCn z2(m$t?lm%CUytV@?arJQZL&gKw=O2(5b+e`PnEMd)YB?hsJLuQZ&zwm4p9ZMaB*|> za@5vcO3aYENke_3B8ulssl&s?|NMjSf9ntrPF*IsA{K?J6Lu$me}VvX@9Jq)X;?=7 E7s{Svl>h($ literal 0 HcmV?d00001 diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/index.ts b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/index.ts new file mode 100644 index 0000000..e558da1 --- /dev/null +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/index.ts @@ -0,0 +1,165 @@ +import tl = require('azure-pipelines-task-lib/task'); +import shell = require("shelljs"); +import path = require("path"); +import fs = require('fs'); +import { IhttpHelper } from './IhttpHelper'; +import { httpHelper } from './httpHelper'; +const nexus : IhttpHelper = new httpHelper(); + +async function run() { + console.log(`Downloading artifact.`); + try { + // Are we debugging? + const systemDebug = (/true/i).test((process.env.SYSTEM_DEBUG ? process.env.SYSTEM_DEBUG : "false")); + // Get the task parameters + const connection : string | undefined = tl.getInput("connection", false); + + if(!connection) + { + throw new Error("Invalid service endpoint."); + } + + // Get the service connection details for communicating with Nexus + let hostUri : URL | undefined = new URL(tl.getEndpointUrl(connection, false)); + + if(!hostUri) + { + throw new Error("A valid Nexus service connection Url is required!"); + } + + const auth: tl.EndpointAuthorization | undefined = tl.getEndpointAuthorization(connection, false); + + if(!auth) { + throw new Error("A valid Nexus service connections is required!"); + } + + // Token, + tl.debug(`Service endpoint auth.scheme '${auth.scheme}'.`); + + // Get the SSL cert options + const acceptUntrustedCerts = (/true/i).test((tl.getEndpointDataParameter(connection, "acceptUntrustedCerts", true) ? tl.getEndpointDataParameter(connection, "acceptUntrustedCerts", true) : "false")); + tl.debug(`acceptUntrustedCerts is set to '${acceptUntrustedCerts}'.`); + + // Get the Nexus repository details + const repository: string | undefined = tl.getInput("definition", true); + const group: string | undefined = tl.getInput("group", true); + const artifact: string | undefined = tl.getInput("artifact", true); + const baseVersion: string | undefined = tl.getInput("version", true); + const packaging: string | undefined = tl.getInput("packaging", true); + const classifier: string | undefined = tl.getInput("classifier", false); + const extension: string | undefined = tl.getInput("extension", false); + const downloadPath: string | undefined = tl.getInput("downloadPath", false); + + // Verify artifact download path is set + if(!downloadPath) + { + throw new Error("Invalid downloadPath."); + } + + tl.debug(`Checking if downloadPath folder '${downloadPath}' exists.`); + // Create the repo folder if doesnt exist + if (!fs.existsSync(downloadPath)) { + tl.debug('downloadPath folder does not exist therefore creating folder.'); + shell.mkdir(downloadPath); + } + + // Set working folder + shell.cd(downloadPath); + + // Get the proxy configured for the DevOps Agent + const agentProxy : tl.ProxyConfiguration | null = tl.getHttpProxyConfiguration(); + const httpProxy : string | undefined = process.env.HTTP_PROXY; + const httpsProxy : string | undefined = process.env.HTTPS_PROXY; + + if(httpProxy) + { + tl.debug(`Environment Variable HTTP_PROXY set to '${httpProxy}'.`); + } + if(httpsProxy) + { + tl.debug(`Environment Variable HTTPS_PROXY set to '${httpsProxy}'.`); + } + + // Is a Proxy set? + if(agentProxy) + { + tl.debug(`Agent proxy is set to '${agentProxy.proxyUrl}'.`); + } + + tl.debug(`HostUri set to '${hostUri}'`); + // https://support.sonatype.com/hc/en-us/articles/213465488 + // https://repository.sonatype.org/nexus-restlet1x-plugin/default/docs/path__artifact_maven_redirect.html + // Build the final search uri + let requestPath : string = `/service/local/artifact/maven/redirect`; + + // Handle root path + if(hostUri.pathname !== "/") + { + requestPath = path.join(hostUri.pathname, requestPath); + } + hostUri.pathname = requestPath; + + // Query Parameters + hostUri.searchParams.append("r", repository); + hostUri.searchParams.append("g", group); + hostUri.searchParams.append("a", artifact); + hostUri.searchParams.append("v", baseVersion); + hostUri.searchParams.append("p", packaging); + + // Do we have a extension + if (extension) { + console.log(`Using extension ${extension}.`); + hostUri.searchParams.append("e", extension); + } + else + { + console.log('Extension has not been supplied.'); + } + + // Do we have a classifier + if (classifier) { + console.log(`Using classifier ${classifier}.`); + hostUri.searchParams.append("c", classifier); + } + else + { + console.log('Classifier has not been supplied.'); + } + + console.log(`Search for asset using '${hostUri}'.`); + try { + // need to refactor this logic to reduce duplication of code + if (hostUri.protocol === "https:") { + if(auth.scheme === "UsernamePassword") + { + await nexus.execute_https(hostUri, acceptUntrustedCerts, auth.parameters["username"], auth.parameters["password"]); + } + else + { + await nexus.execute_https(hostUri, acceptUntrustedCerts); + } + } + else + { + if(auth.scheme === "UsernamePassword") + { + await nexus.execute_http(hostUri, auth.parameters["username"], auth.parameters["password"]); + } + else + { + await nexus.execute_http(hostUri); + } + } + console.log(`Completed search for asset using '${hostUri}'.`); + } catch (inner_err) { + console.log(`Could not complete search for asset using '${hostUri}'.`); + throw inner_err; + } + } + catch (err) { + tl.setResult(tl.TaskResult.Failed, err.message); + } + console.log(`Downloading artifact completed.`); +} + +run(); diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/package-lock.json b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/package-lock.json new file mode 100644 index 0000000..eb91cfe --- /dev/null +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/package-lock.json @@ -0,0 +1,508 @@ +{ + "name": "download-artifacts-nexus-v2", + "version": "2.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.8.3" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "dev": true + }, + "@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/node": { + "version": "12.12.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.15.tgz", + "integrity": "sha512-Pv+vWicyFd07Hw/SmNnTUguqrHgDfMtjabvD9sQyxeqbpCEg8CmViLBaVPHtNsoBgZECrRf5/pgV6FJIBrGSjw==", + "dev": true + }, + "@types/shelljs": { + "version": "0.8.6", + "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.6.tgz", + "integrity": "sha512-svx2eQS268awlppL/P8wgDLBrsDXdKznABHJcuqXyWpSKJgE1s2clXlBvAwbO/lehTmG06NtEWJRkAk4tAgenA==", + "dev": true, + "requires": { + "@types/glob": "*", + "@types/node": "*" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "azure-pipelines-task-lib": { + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-2.9.3.tgz", + "integrity": "sha512-SPWKSfgmjyBDVIMzXnnPH0Gv7YXZ+AQ3SyIhNNALAmQpOltqJhgslvzrOClR5rKuoOyJlG0AWZILbZIXCkztAA==", + "requires": { + "minimatch": "3.0.4", + "mockery": "^1.7.0", + "q": "^1.1.2", + "semver": "^5.1.0", + "shelljs": "^0.3.0", + "uuid": "^3.0.1" + }, + "dependencies": { + "shelljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=" + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "fs": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", + "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "interpret": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", + "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "mock-require": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/mock-require/-/mock-require-3.0.3.tgz", + "integrity": "sha512-lLzfLHcyc10MKQnNUCv7dMcoY/2Qxd6wJfbqCcVk3LDb8An4hF6ohk5AztrvgKhJCqj36uyzi/p5se+tvyD+Wg==", + "dev": true, + "requires": { + "get-caller-file": "^1.0.2", + "normalize-path": "^2.1.1" + } + }, + "mockery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/mockery/-/mockery-1.7.0.tgz", + "integrity": "sha1-9O3g2HUMHJcnwnLqLGBiniyaHE8=" + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "path": { + "version": "0.12.7", + "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", + "integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=", + "requires": { + "process": "^0.11.1", + "util": "^0.10.3" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "requires": { + "resolve": "^1.1.6" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "resolve": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz", + "integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==", + "requires": { + "path-parse": "^1.0.6" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "shelljs": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz", + "integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==", + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "tslib": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "dev": true + }, + "tslint": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.1.tgz", + "integrity": "sha512-kd6AQ/IgPRpLn6g5TozqzPdGNZ0q0jtXW4//hRcj10qLYBaa3mTUU2y2MCG+RXZm8Zx+KZi0eA+YCrMyNlF4UA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^4.0.1", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.3", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.10.0", + "tsutils": "^2.29.0" + } + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "typescript": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "dev": true + }, + "typescript-tslint-plugin": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/typescript-tslint-plugin/-/typescript-tslint-plugin-0.5.5.tgz", + "integrity": "sha512-tR5igNQP+6FhxaPJYRlUBVsEl0n5cSuXRbg7L1y80mL4B1jUHb8uiIcbQBJ9zWyypJEdFYFUccpXxvMwZR8+AA==", + "dev": true, + "requires": { + "minimatch": "^3.0.4", + "mock-require": "^3.0.3", + "vscode-languageserver": "^5.2.1" + } + }, + "util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } + } + }, + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + }, + "vscode-jsonrpc": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz", + "integrity": "sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==", + "dev": true + }, + "vscode-languageserver": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-5.2.1.tgz", + "integrity": "sha512-GuayqdKZqAwwaCUjDvMTAVRPJOp/SLON3mJ07eGsx/Iq9HjRymhKWztX41rISqDKhHVVyFM+IywICyZDla6U3A==", + "dev": true, + "requires": { + "vscode-languageserver-protocol": "3.14.1", + "vscode-uri": "^1.0.6" + } + }, + "vscode-languageserver-protocol": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz", + "integrity": "sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g==", + "dev": true, + "requires": { + "vscode-jsonrpc": "^4.0.0", + "vscode-languageserver-types": "3.14.0" + } + }, + "vscode-languageserver-types": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz", + "integrity": "sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A==", + "dev": true + }, + "vscode-uri": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-1.0.8.tgz", + "integrity": "sha512-obtSWTlbJ+a+TFRYGaUumtVwb+InIUVI0Lu0VBUAPmj2cU5JutEXg3xUE0c2J5Tcy7h2DEKVJBFi+Y9ZSFzzPQ==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + } + } +} diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/package.json b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/package.json new file mode 100644 index 0000000..5a10088 --- /dev/null +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/package.json @@ -0,0 +1,21 @@ +{ + "name": "download-artifacts-nexus-v2", + "version": "2.0.0", + "description": "", + "main": "index.js", + "author": "Gareth Emslie", + "license": "MIT", + "dependencies": { + "azure-pipelines-task-lib": "^2.9.3", + "fs": "0.0.1-security", + "path": "^0.12.7", + "shelljs": "^0.8.3" + }, + "devDependencies": { + "@types/node": "^12.12.15", + "@types/shelljs": "^0.8.6", + "tslint": "^6.1.0", + "typescript": "^3.8.3", + "typescript-tslint-plugin": "^0.5.5" + } +} diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/task.json b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/task.json new file mode 100644 index 0000000..7291788 --- /dev/null +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/task.json @@ -0,0 +1,206 @@ +{ + "$schema": "https://raw.githubusercontent.com/Microsoft/azure-pipelines-task-lib/master/tasks.schema.json", + "id": "a843bbfd-4ced-4e8d-8102-cf2f193ee283", + "name": "DownloadArtifactsNexusMavenRepository", + "friendlyName": "Download Artifacts - Nexus Maven Repository v2", + "description": "Download Nexus Maven Repository v2 Artifact", + "helpMarkDown": "[More Information](https://marketplace.visualstudio.com/items?itemName=soft-cor.nexus-custom-release-artifact-extension)", + "category": "Deploy", + "visibility": ["Release"], + "demands": [], + "runsOn": [ + "Agent", + "MachineGroup" + ], + "preview": false, + "author": "soft-cor", + "version": { + "Major": 0, + "Minor": 2, + "Patch": 49 + }, + "minimumAgentVersion": "2.144.0", + "instanceNameFormat": "Download Artifacts - Nexus Maven Repository v2", + "inputs": [ + { + "name": "connection", + "aliases": [ + "NexusConnection" + ], + "type": "connectedService:nexus", + "label": "Nexus service connection", + "defaultValue": "", + "required": true, + "helpMarkDown": "Nexus Repository service connection" + }, + { + "name": "definition", + "aliases": [ + "RepositoryId", + "repository" + ], + "type": "pickList", + "label": "Repository Id", + "defaultValue": "", + "required": true, + "properties": { + "EditableOptions": "True" + }, + "helpMarkDown": "Name of the Nexus Repository in which to look for the component." + }, + { + "name": "group", + "aliases": [ + "GroupId" + ], + "type": "pickList", + "label": "Group Id", + "defaultValue": "", + "required": true, + "properties": { + "EditableOptions": "True" + }, + "helpMarkDown": "The Maven groupId for a component." + }, + { + "name": "artifact", + "aliases": [ + "ArtifactId" + ], + "type": "pickList", + "label": "Artifact Id", + "defaultValue": "", + "required": true, + "properties": { + "EditableOptions": "True" + }, + "helpMarkDown": "The Maven artifactId for a component." + }, + { + "name": "version", + "aliases": [ + "BaseVersion" + ], + "type": "pickList", + "label": "Base Version", + "defaultValue": "", + "required": true, + "properties": { + "EditableOptions": "True" + }, + "helpMarkDown": "The base version of the component/asset." + }, + { + "name": "packaging", + "aliases": [ + "Packaging" + ], + "options": { + "pom": "pom", + "jar": "jar", + "ejb": "ejb", + "war": "war", + "ear": "ear", + "aar": "aar", + "tar.gz": "tar.gz", + "rar": "rar", + "zip": "zip", + "par": "par", + "maven-archetype": "maven-archetype", + "maven-plugin": "maven-plugin" + }, + "label": "Packaging", + "type": "pickList", + "defaultValue": "", + "required": true, + "properties": { + "EditableOptions": "True" + }, + "helpMarkDown": "The Maven packaging for a component, which is jar by default. Other values as used in Maven and other build tools are ear, war, maven-plugin, pom, ejb, zip, tar.gz, aar and many others." + }, + { + "name": "classifier", + "aliases": [ + "Classifier" + ], + "type": "string", + "label": "Classifier", + "defaultValue": "", + "required": false, + "helpMarkDown": "The Maven classifier for a component. Common values are javadoc, sources or tests." + }, + { + "name": "extension", + "aliases": [ + "Extension" + ], + "type": "string", + "label": "Extension", + "defaultValue": "", + "required": false, + "helpMarkDown": "The extension used for a specific asset of a component." + }, + { + "name": "downloadPath", + "aliases": [ + "DownloadPath" + ], + "type": "string", + "label": "Download Path", + "defaultValue": "$(System.ArtifactsDirectory)", + "required": true, + "helpMarkDown": "Path on the agent machine where the artifacts will be downloaded" + } + ], + "OutputVariables": [{ + "name" : "MAVEN_REPOSITORY_ASSET_FILENAME", + "description" : "Filename of the Asset which was downloaded from your Maven Repository." + }], + "dataSourceBindings": [ + { + "target": "definition", + "endpointId": "$(connection)", + "endpointUrl":"{{{endpoint.url}}}service/local/all_repositories", + "resultSelector":"jsonpath:$.data[?(@.provider=='maven2')]", + "resultTemplate": "{ \"Value\" : \"{{{id}}}\", \"DisplayValue\" : \"{{{id}}}\" }" + }, + { + "target": "group", + "endpointId": "$(connection)", + "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{definition}}}&cn=maven", + "parameters":{ + "definition": "$(definition)" + }, + "resultSelector":"jsonpath:$.data[*].groupId", + "resultTemplate": "{ \"Value\" : \"{{{defaultResultKey}}}\", \"DisplayValue\" : \"{{{defaultResultKey}}}\" }" + }, + { + "target": "artifact", + "endpointId": "$(connection)", + "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{definition}}}&g={{{group}}}", + "parameters":{ + "definition": "$(definition)", + "group":"$(group)" + }, + "resultSelector":"jsonpath:$.data[*].artifactId", + "resultTemplate": "{ \"Value\" : \"{{{defaultResultKey}}}\", \"DisplayValue\" : \"{{{defaultResultKey}}}\" }" + }, + { + "target": "version", + "endpointId": "$(connection)", + "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{definition}}}&g={{{group}}}&a={{{artifact}}}", + "parameters":{ + "definition": "$(definition)", + "group":"$(group)", + "artifact":"$(artifact)" + }, + "resultSelector":"jsonpath:$.data[*].version", + "resultTemplate": "{ \"Value\" : \"{{{defaultResultKey}}}\", \"DisplayValue\" : \"{{{defaultResultKey}}}\" }" + } + ], + "execution": { + "Node10": { + "target": "index.js" + } + } +} \ No newline at end of file diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/IhttpHelper.ts b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/IhttpHelper.ts new file mode 100644 index 0000000..9885bd2 --- /dev/null +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/IhttpHelper.ts @@ -0,0 +1,6 @@ +export interface IhttpHelper { + execute_http(searchUri : URL) : Promise; + execute_http(searchUri : URL, username? : string, password? : string) : Promise; + execute_https(searchUri : URL, acceptUntrustedCerts : boolean) : Promise; + execute_https(searchUri : URL, acceptUntrustedCerts : boolean, username? : string, password? : string) : Promise +}; \ No newline at end of file diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/httpHelper.ts b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/httpHelper.ts new file mode 100644 index 0000000..5efbfe2 --- /dev/null +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/httpHelper.ts @@ -0,0 +1,138 @@ +import tl = require('azure-pipelines-task-lib/task'); +import path = require("path"); +import fs = require('fs'); +import http = require('http'); +import https = require('https'); +import { IhttpHelper } from './IhttpHelper'; + +export class httpHelper implements IhttpHelper { + + public async execute_http(searchUri : URL) : Promise; + public async execute_http(searchUri : URL, username? : string, password? : string) : Promise + { + tl.debug(`execute_http.`); + + let options : http.RequestOptions = { + host: searchUri.hostname, + path: `${searchUri.pathname}?${searchUri.searchParams}`, + method: 'GET', + headers: { + 'Accept': 'application/json' + } + }; + + if(username && + password) + { + const authBase64 : string = Buffer.from(username + ':' + password).toString('base64'); + + // Make sure the secret is correctly scrubbed from any logs + tl.setSecret(authBase64); + options.headers['Authorization'] = 'Basic ' + authBase64; + } + + // Setup new agent dont use the global one + options.agent = new http.Agent(); + options.port = searchUri.port || options.defaultPort; + + // execute the http request + await this.execute_request(http, options); + } + + public async execute_https(searchUri : URL, acceptUntrustedCerts : boolean) : Promise; + public async execute_https(searchUri : URL, acceptUntrustedCerts : boolean, username? : string, password? : string) : Promise + { + tl.debug(`execute_https.`); + + let options : https.RequestOptions = { + host: searchUri.hostname, + path: `${searchUri.pathname}?${searchUri.searchParams}`, + method: 'GET', + rejectUnauthorized: !acceptUntrustedCerts, // By default ensure we validate SSL certificates + headers: { + 'Accept': 'application/json' + } + }; + + if(username && + password) + { + const authBase64 : string = Buffer.from(username + ':' + password).toString('base64'); + + // Make sure the secret is correctly scrubbed from any logs + tl.setSecret(authBase64); + options.headers['Authorization'] = 'Basic ' + authBase64; + } + + // Setup new agent dont use the global one + options.agent = new https.Agent(); + options.port = searchUri.port || options.defaultPort; + + // execute the https request + await this.execute_request(https, options); + } + + private async execute_request(client : any, options : http.RequestOptions | https.RequestOptions) : Promise + { + tl.debug(`HTTP Request Options: ${JSON.stringify(options)}.`); + + return new Promise((resolve, reject) => { + let req : http.ClientRequest = client.request(options, function(res : http.IncomingMessage) { + tl.debug(`HTTP Response Status Code: ${res.statusCode}.`); + tl.debug(`HTTP Response Status Message: ${res.statusMessage}.`); + tl.debug(`HTTP Response Headers: ${JSON.stringify(res.headers)}.`); + + if (res.statusCode == 302) { + const downloadUri : URL = new URL(res.headers.location); + + // Set correct options for the new request to download our file + options.host = downloadUri.hostname; + options.path = downloadUri.pathname; + options.port = downloadUri.port || options.defaultPort; + + console.log(`Download asset using '${downloadUri}'.`); + let filename : string = path.basename(downloadUri.pathname); + console.log(`Download filename '${filename}'`); + + let inner_req : http.ClientRequest = client.request(options, function(inner_res : http.IncomingMessage) { + tl.debug(`HTTP Response Status Code: ${inner_res.statusCode}.`); + tl.debug(`HTTP Response Status Message: ${inner_res.statusMessage}.`); + tl.debug(`HTTP Response Headers: ${JSON.stringify(inner_res.headers)}.`); + + if(inner_res.statusCode == 200) + { + const file : fs.WriteStream = fs.createWriteStream(filename); + inner_res.on('data', function(chunk : any){ + file.write(chunk); + }).on('end', function(){ + file.end(); + }); + console.log(`##vso[task.setvariable variable=MAVEN_REPOSITORY_ASSET_FILENAME;isSecret=false;isOutput=true;]${filename}`) + console.log(`Successfully downloaded asset '${filename}' using '${downloadUri}'.`); + resolve(); + } else + { + console.log(`Asset download was not successful!`); + reject(`Asset download was not successful!`); + } + }); + inner_req.end(); + }else + { + tl.debug(`Asset search was not successful!`); + let message : string = `Asset search was not successful!`; + if (res.statusCode == 400) { + message = `Search returned multiple assets, please refine search criteria to find a single asset!`; + } else if (res.statusCode == 401) { + message = `Invalid Nexus Repo Manager credentials!`; + } else if (res.statusCode == 404) { + message = `Asset does not exist for search, or invalid Nexus Repo Manager Url!`; + } + console.log(message); + reject(message); + } + }); + req.end(); + }); + } +} \ No newline at end of file diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/icon.png b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c6261b14f93f25949a4933c6d6ba47f316c63c83 GIT binary patch literal 4431 zcma)AXHXMNyA3V$4uYXc2bCs*1|d`lyeh>4VyM!4=)D>U9i&$QQ9&u8h;$NqlTZR7 zC{21%2)$~q?|k2VuiwnQGxwP}`^>ZZYxkVz%*4Pl{x@iV zzsD|!)zI%m=JgP&0jR?AZu~AN?bRQs0{}J2^cPlCziV2!j)@llz|{3O$okyNYybe3 zWnC@x$NuI&%p4O$pKw-f77Q$W)_EE&D$M%)aVAS(q~Ri)VM%zeXm1!>$9-ldr|z)s zLux0DPUaY#>tbY_2)7>_O(PFmHP0|WKAfG56B>2jF7VQN+eN$APLoghW_#$)@IlZl z>MV3}ZO*HGX9jlo!ELhK7}adf#`;Ipyh{0^6!XJ+iRWc4Skp*BE={!rqr1;A{@!6R zr#VNO=9CZLw&J;wIGU$4O_A2(S6x+<3Qm`4~F!jJ2$I}~^>uYUY`ogQ(vx4f!#=BMQU$d*e>V67dE~cMA z8zRI{uiE(#R|EhipJ=bG7xXWwX?U_Kvp&Xde4i>Wz~*eiMV?Iz?-|;=`FW>jG`rM~ z<7{YF>KSNBG(;zkyo7nN(U#9@#a@p-78#G-4GAG@@o)Ay$I^nE{3rnD%h#TY+Vz=Y zv%eLLs_#T+y7)vj79KYAE5CF%L4e; z{Q>TvTv8E|$0KhxD2SuZ#YYYvmLAGegC34Swjz?Qgv+owf(X$k5S+I z%%L5+Rn-W!R=$$;)aTT-pOoX68uyfg3w9c8KUPq*qt-vRLomjn5a3`t#iL^t^-fjt zR=OjxX;@Q8txgYAnu!WvI;nMO{Zr|Um|=4btb91C?%kPT!cXIcQ;I8h zqFcoY+PO_2K7!iSR0L65=3`C%PQ#lt>!f8LeXgfyOCz>)h1?8E+eAB2b(0bkT?4$s zpHqfQ_2H`e+lnO6DiDBh{66Vt?fu!4dPS$B4=A@?vx&UDw03H%*?}fs`J0D%3GKm66y5Hp1wP7JvZlZZ<4MJF*0Wl6`(DU}Chmo3t!fB940U=-w{G+S`4{ zN%I!CcVg$2p3w2n*4&NOD+hPGM}*l<)&Oe0G+$%6=-Qdi8yvf0Q`5sM<+2l^2NEuI zu`9Yk*K9m3dFwj~e{-rVy%)!i4`5&Kdde)&H`r+J=@+Vdn}A!##;Vi6Jo+2izUAbK zY%vmfB)Q1lT9?E{8d8|izsZG;J#=P>MpZL9#B?qeWELV!QrRv_BjI@QjdQbETYCCzDN zLg%?_B0u2{MLrn~C^%Mn$RtkWzk_Q<`h-&5WIPsRY3MjoXqDs$`X#B;dU<=epWqTW zwLR=wyaapPj%-Kz8-VzRBew|0m6~Nn5w`iWP6DW81 z0#s*4N>=QuxP6P}7j%($%1$0L`*+QxM2jIM@T!jav3JBF{r}GRKO)G^mN|dOokX6~ zw$wtLd*#|q)5MPzn^wQ=w7`M3#tyF~6s~14QjzHL-6gL62S66$yzd`WrBX~9CaXrWl`KWHZ`Y^>dSp~3?A(q59WTt- zTbHc3nlzMNLxE?Uo48<|DKmVmmq)MD4^NqMs zah*wn`B>Z%k!`Ih=ydwFkc3a3*;e*jV(K|!q%g-BcsRh$-;w&?iNg7%*!ro61DCeef(Y7~TYv|}5Xt2PAfTb+2 zd3K(h5XO|+Em&3{BIr(nA4NPCOBXAO@GgXH1=1)?oOT=h5}J9i?T#jxHCTyA@)Xl!>e1Ae`M>9mh zslA?lk4GcbhQ8a+y8BHAKD2VQn9AIA^HtN!sSj?&p$*>sKs@W*%le7agDmDR!l4iV z+_RcWsPNKNOXzb6)5=g?uA(C^smWUDc8`|w@|w{MN_3G)m6#G*d@ioUa$~9sw`@xg zVop|M;;9eU8{gOr!r!-0*v~3$b+N12D%-bKTbb%gwoJb$&R=EJ;oc?cRC(!V-ZDX#SDr|P@$HNb9QeU?3D1lekQVa1L5<@zG$Q4ibg+(CIF_{{d>KPR6tZYWcTi+?yG=wssz8*ZkU$6qhmK15T$eZa55B*H;f?;h9qr zGO96c7+4_E2yl!g8wv*~$6nD$tXMX{I=(}JE~vmwoNZ!0E_DoF-T8UuZ~SqA-s0(C z<~%v+3sc~Y_7}W?rFhb4Ibm3F1eNS@lIi$iV~qI7%KTq%V)*V2Wm`E#&j#f%ENO8guHnp*q zDSk0;2I}Fb=_yhgRn%~W#(IOus?TTZHoqv(0YHou+jd(UI?U2KQ*2&sTl9P;dp3T8UF?^s=Xol~(RTZ(y#uE6{0x@I} zF^@#puiD%DQ%V$#RxvOj(n+Qmdwsfy+Ezi%W|qGk<6h@T6WKM^5pLjd?*~@aqCqC5 zd15B5;h4F&1nq`{cuGaWUqUsz7W}{?ZgW(~E{FJmTBSx+}p9 z+fS;!tY%vzZ$7^pA@%FVCsFrbCz9WbPp5MNSg+Gj0D@G)C=vQ8%@n?@l6#(p5qcE= z_+zrIiRZ0G7+hpQQ;5=SgrArH8)tj`%L7*tvpA*;R2;o!Uw#C0;kDtXqe=W4rH3p= zK{-ZG1tQJpzK%|*68qlvP=VP_cyja;zeH)z?7#KsG3d9ogu#pxXif!_i1l>Hf6@Dg zQO2?8m!aegg$t5nTF4H4*#jv6!nX2p<%atnHQt{CU~P zKUL3ozRvFKLk?Pb#a2Gv3>reqiPZWgwIKUl6+gmw7q0dG-*#8QNtGBa^wjU3jPoY$ z`?C)jZXfJ-J*xML`nzr`UN9UAeTjnV_Zw6jaoqg3t+IZIWtnH4^`t^qDTN6u-3v`H z`2D!+%vVL86TOrM?8q=NAccID0~5y96VxZhD>nCn z2(m$t?lm%CUytV@?arJQZL&gKw=O2(5b+e`PnEMd)YB?hsJLuQZ&zwm4p9ZMaB*|> za@5vcO3aYENke_3B8ulssl&s?|NMjSf9ntrPF*IsA{K?J6Lu$me}VvX@9Jq)X;?=7 E7s{Svl>h($ literal 0 HcmV?d00001 diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/index.ts b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/index.ts new file mode 100644 index 0000000..464fb1a --- /dev/null +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/index.ts @@ -0,0 +1,169 @@ +import tl = require('azure-pipelines-task-lib/task'); +import shell = require("shelljs"); +import path = require("path"); +import fs = require('fs'); +import { IhttpHelper } from './IhttpHelper'; +import { httpHelper } from './httpHelper'; +const nexus : IhttpHelper = new httpHelper(); + +async function run() { + console.log(`Downloading artifact.`); + try { + // Are we debugging? + const systemDebug = (/true/i).test((process.env.SYSTEM_DEBUG ? process.env.SYSTEM_DEBUG : "false")); + // Get the task parameters + const connection : string | undefined = tl.getInput("connection", false); + + if(!connection) + { + throw new Error("Invalid service endpoint."); + } + + // Get the service connection details for communicating with Nexus + let hostUri : URL | undefined = new URL(tl.getEndpointUrl(connection, false)); + + if(!hostUri) + { + throw new Error("A valid Nexus service connection Url is required!"); + } + + const auth: tl.EndpointAuthorization | undefined = tl.getEndpointAuthorization(connection, false); + + if(!auth) { + throw new Error("A valid Nexus service connections is required!"); + } + + // Token, + tl.debug(`Service endpoint auth.scheme '${auth.scheme}'.`); + + // Get the SSL cert options + const acceptUntrustedCerts = (/true/i).test((tl.getEndpointDataParameter(connection, "acceptUntrustedCerts", true) ? tl.getEndpointDataParameter(connection, "acceptUntrustedCerts", true) : "false")); + tl.debug(`acceptUntrustedCerts is set to '${acceptUntrustedCerts}'.`); + + // Get the Nexus repository details + const repository: string | undefined = tl.getInput("definition", true); + const group: string | undefined = tl.getInput("group", true); + const artifact: string | undefined = tl.getInput("artifact", true); + const baseVersion: string | undefined = tl.getInput("version", true); + const packaging: string | undefined = tl.getInput("packaging", true); + const classifier: string | undefined = tl.getInput("classifier", false); + let extension: string | undefined = tl.getInput("extension", false); + const downloadPath: string | undefined = tl.getInput("downloadPath", false); + + // Do we have a extension + if (!extension) { + console.log('Extension has not been supplied, set default packaging extension.'); + extension = packaging; + } + + // Verify artifact download path is set + if(!downloadPath) + { + throw new Error("Invalid downloadPath."); + } + + tl.debug(`Checking if downloadPath folder '${downloadPath}' exists.`); + // Create the repo folder if doesnt exist + if (!fs.existsSync(downloadPath)) { + tl.debug('downloadPath folder does not exist therefore creating folder.'); + shell.mkdir(downloadPath); + } + + // Set working folder + shell.cd(downloadPath); + + // Get the proxy configured for the DevOps Agent + const agentProxy : tl.ProxyConfiguration | null = tl.getHttpProxyConfiguration(); + const httpProxy : string | undefined = process.env.HTTP_PROXY; + const httpsProxy : string | undefined = process.env.HTTPS_PROXY; + + if(httpProxy) + { + tl.debug(`Environment Variable HTTP_PROXY set to '${httpProxy}'.`); + } + if(httpsProxy) + { + tl.debug(`Environment Variable HTTPS_PROXY set to '${httpsProxy}'.`); + } + + // Is a Proxy set? + if(agentProxy) + { + tl.debug(`Agent proxy is set to '${agentProxy.proxyUrl}'.`); + } + + tl.debug(`HostUri set to '${hostUri}'`); + // https://help.sonatype.com/repomanager3/rest-and-integration-api/search-api + // Build the final search uri + let requestPath : string = `/service/rest/v1/search/assets/download`; + + // Handle root path + if(hostUri.pathname !== "/") + { + requestPath = path.join(hostUri.pathname, requestPath); + } + hostUri.pathname = requestPath; + + // Query Parameters + + // *** ONLY Works in Nexus 3.16+ *** + // https://help.sonatype.com/repomanager3/rest-and-integration-api/search-api#SearchAPI-DownloadingtheLatestVersionofanAsset + // We could use /service/rest/v1/status and look at the response header "server: Nexus/3.21.1-01 (OSS)" + // hostUri.searchParams.append("sort", "version"); + // *** ONLY Works in Nexus 3.16+ *** + + hostUri.searchParams.append("repository", repository); + hostUri.searchParams.append("maven.groupId", group); + hostUri.searchParams.append("maven.artifactId", artifact); + hostUri.searchParams.append("maven.baseVersion", baseVersion); + hostUri.searchParams.append("maven.extension", extension); + hostUri.searchParams.append("maven.classifier", ""); + + // Do we have a classifier + if (classifier) { + console.log(`Using classifier ${classifier}.`); + hostUri.searchParams.set("maven.classifier",classifier); + } + else + { + console.log('Classifier has not been supplied.'); + } + + console.log(`Search for asset using '${hostUri}'.`); + try { + // need to refactor this logic to reduce duplication of code + if (hostUri.protocol === "https:") { + if(auth.scheme === "UsernamePassword") + { + await nexus.execute_https(hostUri, acceptUntrustedCerts, auth.parameters["username"], auth.parameters["password"]); + } + else + { + await nexus.execute_https(hostUri, acceptUntrustedCerts); + } + } + else + { + if(auth.scheme === "UsernamePassword") + { + await nexus.execute_http(hostUri, auth.parameters["username"], auth.parameters["password"]); + } + else + { + await nexus.execute_http(hostUri); + } + } + console.log(`Completed search for asset using '${hostUri}'.`); + } catch (inner_err) { + console.log(`Could not complete search for asset using '${hostUri}'.`); + throw inner_err; + } + + } + catch (err) { + tl.setResult(tl.TaskResult.Failed, err.message); + } + console.log(`Downloading artifact completed.`); +} + +run(); diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/package-lock.json b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/package-lock.json new file mode 100644 index 0000000..1dc2523 --- /dev/null +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/package-lock.json @@ -0,0 +1,508 @@ +{ + "name": "download-artifacts-nexus-v3", + "version": "3.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.8.3" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.0.tgz", + "integrity": "sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/node": { + "version": "12.12.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.15.tgz", + "integrity": "sha512-Pv+vWicyFd07Hw/SmNnTUguqrHgDfMtjabvD9sQyxeqbpCEg8CmViLBaVPHtNsoBgZECrRf5/pgV6FJIBrGSjw==", + "dev": true + }, + "@types/shelljs": { + "version": "0.8.6", + "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.6.tgz", + "integrity": "sha512-svx2eQS268awlppL/P8wgDLBrsDXdKznABHJcuqXyWpSKJgE1s2clXlBvAwbO/lehTmG06NtEWJRkAk4tAgenA==", + "dev": true, + "requires": { + "@types/glob": "*", + "@types/node": "*" + } + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "azure-pipelines-task-lib": { + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-2.9.3.tgz", + "integrity": "sha512-SPWKSfgmjyBDVIMzXnnPH0Gv7YXZ+AQ3SyIhNNALAmQpOltqJhgslvzrOClR5rKuoOyJlG0AWZILbZIXCkztAA==", + "requires": { + "minimatch": "3.0.4", + "mockery": "^1.7.0", + "q": "^1.1.2", + "semver": "^5.1.0", + "shelljs": "^0.3.0", + "uuid": "^3.0.1" + }, + "dependencies": { + "shelljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=" + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "fs": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", + "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "interpret": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", + "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.4.tgz", + "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "mock-require": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/mock-require/-/mock-require-3.0.3.tgz", + "integrity": "sha512-lLzfLHcyc10MKQnNUCv7dMcoY/2Qxd6wJfbqCcVk3LDb8An4hF6ohk5AztrvgKhJCqj36uyzi/p5se+tvyD+Wg==", + "dev": true, + "requires": { + "get-caller-file": "^1.0.2", + "normalize-path": "^2.1.1" + } + }, + "mockery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/mockery/-/mockery-1.7.0.tgz", + "integrity": "sha1-9O3g2HUMHJcnwnLqLGBiniyaHE8=" + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "path": { + "version": "0.12.7", + "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", + "integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=", + "requires": { + "process": "^0.11.1", + "util": "^0.10.3" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "requires": { + "resolve": "^1.1.6" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "resolve": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz", + "integrity": "sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w==", + "requires": { + "path-parse": "^1.0.6" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "shelljs": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz", + "integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==", + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "tslib": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "dev": true + }, + "tslint": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.0.tgz", + "integrity": "sha512-fXjYd/61vU6da04E505OZQGb2VCN2Mq3doeWcOIryuG+eqdmFUXTYVwdhnbEu2k46LNLgUYt9bI5icQze/j0bQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^4.0.1", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.10.0", + "tsutils": "^2.29.0" + } + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "typescript": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "dev": true + }, + "typescript-tslint-plugin": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/typescript-tslint-plugin/-/typescript-tslint-plugin-0.5.5.tgz", + "integrity": "sha512-tR5igNQP+6FhxaPJYRlUBVsEl0n5cSuXRbg7L1y80mL4B1jUHb8uiIcbQBJ9zWyypJEdFYFUccpXxvMwZR8+AA==", + "dev": true, + "requires": { + "minimatch": "^3.0.4", + "mock-require": "^3.0.3", + "vscode-languageserver": "^5.2.1" + } + }, + "util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } + } + }, + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + }, + "vscode-jsonrpc": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz", + "integrity": "sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==", + "dev": true + }, + "vscode-languageserver": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-5.2.1.tgz", + "integrity": "sha512-GuayqdKZqAwwaCUjDvMTAVRPJOp/SLON3mJ07eGsx/Iq9HjRymhKWztX41rISqDKhHVVyFM+IywICyZDla6U3A==", + "dev": true, + "requires": { + "vscode-languageserver-protocol": "3.14.1", + "vscode-uri": "^1.0.6" + } + }, + "vscode-languageserver-protocol": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz", + "integrity": "sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g==", + "dev": true, + "requires": { + "vscode-jsonrpc": "^4.0.0", + "vscode-languageserver-types": "3.14.0" + } + }, + "vscode-languageserver-types": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz", + "integrity": "sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A==", + "dev": true + }, + "vscode-uri": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-1.0.8.tgz", + "integrity": "sha512-obtSWTlbJ+a+TFRYGaUumtVwb+InIUVI0Lu0VBUAPmj2cU5JutEXg3xUE0c2J5Tcy7h2DEKVJBFi+Y9ZSFzzPQ==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + } + } +} diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/package.json b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/package.json new file mode 100644 index 0000000..48072c0 --- /dev/null +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/package.json @@ -0,0 +1,21 @@ +{ + "name": "download-artifacts-nexus-v3", + "version": "3.0.0", + "description": "", + "main": "index.js", + "author": "Gareth Emslie", + "license": "MIT", + "dependencies": { + "azure-pipelines-task-lib": "^2.9.3", + "fs": "0.0.1-security", + "path": "^0.12.7", + "shelljs": "^0.8.3" + }, + "devDependencies": { + "@types/node": "^12.12.15", + "@types/shelljs": "^0.8.6", + "tslint": "^6.1.0", + "typescript": "^3.8.3", + "typescript-tslint-plugin": "^0.5.5" + } +} diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/task.json b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/task.json new file mode 100644 index 0000000..69bb87e --- /dev/null +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/task.json @@ -0,0 +1,215 @@ +{ + "$schema": "https://raw.githubusercontent.com/Microsoft/azure-pipelines-task-lib/master/tasks.schema.json", + "id": "6a26339d-ca44-4f1c-8511-fde5b7550a68", + "name": "DownloadArtifactsNexusMavenRepositoryV3", + "friendlyName": "Download Artifacts - Nexus Maven Repository v3", + "description": "Download Nexus Maven Repository v3 Artifact", + "helpMarkDown": "[More Information](https://marketplace.visualstudio.com/items?itemName=soft-cor.nexus-custom-release-artifact-extension)", + "category": "Deploy", + "visibility": ["Release"], + "demands": [], + "runsOn": [ + "Agent", + "MachineGroup" + ], + "preview": false, + "author": "soft-cor", + "version": { + "Major": 0, + "Minor": 3, + "Patch": 52 + }, + "minimumAgentVersion": "2.144.0", + "instanceNameFormat": "Download Artifacts - Nexus Maven Repository v3", + "inputs": [ + { + "name": "connection", + "aliases": [ + "NexusConnection" + ], + "type": "connectedService:nexus", + "label": "Nexus service connection", + "defaultValue": "", + "required": true, + "helpMarkDown": "Nexus Repository service connection" + }, + { + "name": "definition", + "aliases": [ + "RepositoryId", + "repository" + ], + "type": "pickList", + "label": "Repository Id", + "defaultValue": "", + "required": true, + "properties": { + "EditableOptions": "True" + }, + "helpMarkDown": "Name of the Nexus Repository in which to look for the component." + }, + { + "name": "group", + "aliases": [ + "GroupId" + ], + "type": "pickList", + "label": "Group Id", + "defaultValue": "", + "required": true, + "properties": { + "EditableOptions": "True" + }, + "helpMarkDown": "The Maven groupId for a component." + }, + { + "name": "artifact", + "aliases": [ + "ArtifactId" + ], + "type": "pickList", + "label": "Artifact Id", + "defaultValue": "", + "required": true, + "properties": { + "EditableOptions": "True" + }, + "helpMarkDown": "The Maven artifactId for a component." + }, + { + "name": "version", + "aliases": [ + "BaseVersion" + ], + "type": "pickList", + "label": "Base Version", + "defaultValue": "", + "required": true, + "properties": { + "EditableOptions": "True" + }, + "helpMarkDown": "The base version of the component/asset." + }, + { + "name": "packaging", + "aliases": [ + "Packaging" + ], + "options": { + "pom": "pom", + "jar": "jar", + "ejb": "ejb", + "war": "war", + "ear": "ear", + "aar": "aar", + "tar.gz": "tar.gz", + "rar": "rar", + "zip": "zip", + "par": "par", + "maven-archetype": "maven-archetype", + "maven-plugin": "maven-plugin" + }, + "label": "Packaging", + "type": "pickList", + "defaultValue": "", + "required": true, + "properties": { + "EditableOptions": "True" + }, + "helpMarkDown": "The Maven packaging for a component, which is jar by default. Other values as used in Maven and other build tools are ear, war, maven-plugin, pom, ejb, zip, tar.gz, aar and many others." + }, + { + "name": "classifier", + "aliases": [ + "Classifier" + ], + "type": "string", + "label": "Classifier", + "defaultValue": "", + "required": false, + "helpMarkDown": "The Maven classifier for a component. Common values are javadoc, sources or tests." + }, + { + "name": "extension", + "aliases": [ + "Extension" + ], + "type": "string", + "label": "Extension", + "defaultValue": "", + "required": false, + "helpMarkDown": "The extension used for a specific asset of a component." + }, + { + "name": "downloadPath", + "aliases": [ + "DownloadPath" + ], + "type": "string", + "label": "Download Path", + "defaultValue": "$(System.ArtifactsDirectory)", + "required": true, + "helpMarkDown": "Path on the agent machine where the artifacts will be downloaded" + } + ], + "OutputVariables": [{ + "name" : "MAVEN_REPOSITORY_ASSET_FILENAME", + "description" : "Filename of the Asset which was downloaded from your Maven Repository." + }], + "dataSourceBindings": [ + { + "target": "definition", + "endpointId": "$(connection)", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/repositories", + "resultSelector":"jsonpath:$.[?(@.format=='maven2')]", + "resultTemplate": "{ \"Value\" : \"{{{name}}}\", \"DisplayValue\" : \"{{{name}}}\" }" + }, + { + "target": "group", + "endpointId": "$(connection)", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{definition}}}{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", + "parameters":{ + "definition": "$(definition)" + }, + "resultSelector":"jsonpath:$.items[*].group", + "resultTemplate": "{ \"Value\" : \"{{{defaultResultKey}}}\", \"DisplayValue\" : \"{{{defaultResultKey}}}\" }", + "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", + "callbackRequiredTemplate": "{{#equals continuationToken null}}false{{else}}true{{/equals}}", + "initialContextTemplate":"{\"continuationToken\" : null}" + }, + { + "target": "artifact", + "endpointId": "$(connection)", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{definition}}}&maven.groupId={{{group}}}{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", + "parameters":{ + "definition": "$(definition)", + "group":"$(group)" + }, + "resultSelector":"jsonpath:$.items[*].name", + "resultTemplate": "{ \"Value\" : \"{{{defaultResultKey}}}\", \"DisplayValue\" : \"{{{defaultResultKey}}}\" }", + "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", + "callbackRequiredTemplate": "{{#notEquals continuationToken null}}true{{/notEquals}}", + "initialContextTemplate":"{\"continuationToken\" : null}" + }, + { + "target": "version", + "endpointId": "$(connection)", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{definition}}}&maven.groupId={{{group}}}&maven.artifactId={{{artifact}}}&sort=version{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", + "parameters":{ + "definition": "$(definition)", + "group":"$(group)", + "artifact":"$(artifact)" + }, + "resultSelector":"jsonpath:$.items[*]", + "resultTemplate": "{ \"Value\" : \"{{{version}}}\", \"DisplayValue\" : \"{{{version}}}\" }", + "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", + "callbackRequiredTemplate": "{{#notEquals continuationToken null}}true{{/notEquals}}", + "initialContextTemplate":"{\"continuationToken\" : null}" + } + ], + "execution": { + "Node10": { + "target": "index.js" + } + } +} \ No newline at end of file diff --git a/package.json b/package.json index 41c57ec..065e7ca 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,10 @@ "scripts": { "postinstall": "cd ./Tasks/DownloadArtifactsNexus && cd ./DownloadArtifactsNexusV2 && npm install && cd ../DownloadArtifactsNexusV3 && npm install", "build": "tsc", + "package:DownloadArtifactsNexusV0_2": "(for %f in (task.json,package.json,icon.png) do xcopy /y /i .\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV0_2\\%f .\\dist\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV0_2\\) && cd ./dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2 && npm install --only=production", + "package:DownloadArtifactsNexusV0_3": "(for %f in (task.json,package.json,icon.png) do xcopy /y /i .\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV0_3\\%f .\\dist\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV0_3\\) && cd ./dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3 && npm install --only=production", "package:DownloadArtifactsNexusV2": "(for %f in (task.json,package.json,icon.png) do xcopy /y /i .\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV2\\%f .\\dist\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV2\\) && cd ./dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2 && npm install --only=production", "package:DownloadArtifactsNexusV3": "(for %f in (task.json,package.json,icon.png) do xcopy /y /i .\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV3\\%f .\\dist\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV3\\) && cd ./dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3 && npm install --only=production", - "package:Server2018VSIX": "npm run build && npm run package:DownloadArtifactsNexusV2 && npm run package:DownloadArtifactsNexusV3 && tfx extension create --manifests vss-extension-server-2018.json --output-path ./dist/", - "package:ServiceVSIX": "npm run build && npm run package:DownloadArtifactsNexusV2 && npm run package:DownloadArtifactsNexusV3 && tfx extension create --manifests vss-extension-service.json --output-path ./dist/", - "package": "npm run package:Server2018VSIX && npm run package:ServiceVSIX" + "package": "npm run build && npm run package:DownloadArtifactsNexusV0_2 && npm run package:DownloadArtifactsNexusV0_3 && npm run package:DownloadArtifactsNexusV2 && npm run package:DownloadArtifactsNexusV3 && tfx extension create --manifests vss-extension.json --output-path ./dist/" } } diff --git a/vss-extension-server-2018.json b/vss-extension-server-2018.json deleted file mode 100644 index dc834be..0000000 --- a/vss-extension-server-2018.json +++ /dev/null @@ -1,752 +0,0 @@ -{ - "manifestVersion": 1, - "id": "nexus-custom-release-artifact-server-2018-extension", - "publisher": "soft-cor", - "version": "1.0.106", - "name": "Sonatype Nexus Repository Release Artifact", - "description": "Add support for Sonatype Nexus Repository as an artifact for Release Pipelines", - "public": true, - "galleryFlags": [ - - ], - "categories": [ "Build and release" ], - "content": { - "details": { - "path": "overview.md" - }, - "license": { - "path": "LICENSE" - } - }, - "links": { - "support": { - "uri": "https://blog.soft-cor.com" - } - }, - "repository": { - "type": "git", - "uri": "https://github.com/keyoke/NexusPipelineArtifact" - }, - "badges": [ - { - "href": "https://dev.azure.com/softcores/NexusPipelineArtifact/_build?definitionId=2&_a=summary", - "uri": "https://dev.azure.com/softcores/NexusPipelineArtifact/_apis/build/status/keyoke.NexusPipelineArtifact?branchName=master", - "description": "Azure Pipeline for NexusPipelineArtifact" - } - ], - "tags": [ - "Sonatype", - "Nexus", - "repository", - "manager", - "continuous", - "release", - "deploy", - "cd" - ], - "targets": [ - { - "id": "Microsoft.VisualStudio.Services" - } - ], - "demands": [ - "api-version/3.0" - ], - "icons": { - "default": "icon-nexus-logo.png" - }, - "screenshots": [ - { - "path": "images/screen1.png" - }, - { - "path": "images/screen2.png" - }, - { - "path": "images/screen3.png" - }, - { - "path": "images/screen4.png" - }, - { - "path": "images/screen5.png" - } - ], - "files": [ - { - "path": "images/screen1.png", - "addressable": true - }, - { - "path": "images/screen2.png", - "addressable": true - }, - { - "path": "images/screen3.png", - "addressable": true - }, - { - "path": "images/screen4.png", - "addressable": true - }, - { - "path": "images/screen5.png", - "addressable": true - }, - { - "path": "icon-nexus-logo.png", - "addressable": true - }, - { - "path": "dist/Tasks/DownloadArtifactsNexus" - } - ], - "contributions": [ - { - "id": "nexus-endpoint-type", - "description": "Service connection type for Sonatype Nexus Repository", - "type": "ms.vss-endpoint.service-endpoint-type", - "targets": [ - "ms.vss-endpoint.endpoint-types" - ], - "properties": { - "name": "nexus", - "displayName": "Sonatype Nexus Repository", - "url": { - "displayName": "Repository URL" - }, - "authenticationSchemes": [ - { - "type": "ms.vss-endpoint.endpoint-auth-scheme-basic", - "inputDescriptors": [ - { - "id": "username", - "name": "Username", - "description": "Username for connecting to the endpoint", - "inputMode": "textbox", - "isConfidential": false, - "validation": { - "isRequired": true, - "dataType": "string" - } - }, - { - "id": "password", - "name": "Password", - "description": "Password for connecting to the endpoint", - "inputMode": "passwordBox", - "isConfidential": true, - "validation": { - "isRequired": true, - "dataType": "string" - } - } - ] - }, - { - "type": "ms.vss-endpoint.endpoint-auth-scheme-none" - } - ], - "inputDescriptors": [ - { - "id": "acceptUntrustedCerts", - "name": "Accept untrusted SSL certificates", - "description": "Allows self-signed SSL certificates.", - "inputMode": "checkbox", - "isConfidential": false, - "validation": { - "isRequired": false, - "dataType": "boolean" - } - } - ], - "dataSources": [ - - ] - }, - "constraints": [ - - ] - }, - { - "id": "nexus-build-release-task", - "type": "ms.vss-distributed-task.task", - "targets": [ - "ms.vss-distributed-task.tasks" - ], - "properties": { - "name": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2" - } - }, - { - "id": "nexus-custom-release-artifact-type", - "description": "Sonatype Nexus Repository v2 Maven Artifact", - "type": "ms.vss-releaseartifact.release-artifact-type", - "targets": [ - "ms.vss-releaseartifact.artifact-types" - ], - "properties": { - "name": "nexus-maven-repository", - "displayName": "MavenRepoV2", - "endpointTypeId": "nexus", - "uniqueSourceIdentifier": "{{connection}}:{{repository}}:{{group}}:{{artifact}}", - "downloadTaskId": "a843bbfd-4ced-4e8d-8102-cf2f193ee283", - "artifactType": "Package", - "inputDescriptors": [ - { - "id": "connection", - "name": "Service connection", - "description": "Nexus service connection", - "inputMode": "Combo", - "isConfidential": false, - "hasDynamicValueInformation": true, - "validation": { - "isRequired": true, - "dataType": "string", - "maxLength": 300 - } - }, - { - "id": "repository", - "name": "Repository Id", - "description": "Name of the Nexus repository in which to look for the component.", - "inputMode": "Combo", - "isConfidential": false, - "hasDynamicValueInformation": true, - "dependencyInputIds": [ - "connection" - ], - "validation": { - "isRequired": true, - "dataType": "string", - "maxLength": 300 - } - }, - { - "id": "group", - "name": "Group Id", - "description": "The Maven groupId for a component.", - "inputMode": "Combo", - "isConfidential": false, - "hasDynamicValueInformation": true, - "dependencyInputIds": [ - "connection", - "repository" - ], - "validation": { - "isRequired": true, - "dataType": "string", - "maxLength": 300 - } - }, - { - "id": "artifact", - "name": "Artifact Id", - "description": "The Maven artifactId for a component.", - "inputMode": "Combo", - "isConfidential": false, - "hasDynamicValueInformation": true, - "dependencyInputIds": [ - "connection", - "repository", - "group" - ], - "validation": { - "isRequired": true, - "dataType": "string", - "maxLength": 300 - } - }, - { - "id": "defaultVersionType", - "name": "Default Version", - "description": "The default version will be deployed when new releases are created. The version can be changed for manually created releases at the time of release creation.", - "inputMode": "Combo", - "isConfidential": false, - "hasDynamicValueInformation": false, - "values": { - "inputId": "defaultVersionTypeValues", - "defaultValue": "latestType", - "possibleValues": [ - { - "value": "latestType", - "displayValue": "Latest" - }, - { - "value": "specificVersionType", - "displayValue": "Specific version" - }, - { - "value": "selectDuringReleaseCreationType", - "displayValue": "Specify at the time of release creation" - } - ], - "isLimitedToPossibleValues": true - }, - "validation": { - "isRequired": true, - "dataType": "string" - } - }, - { - "id": "defaultVersionSpecific", - "name": "baseVersion", - "description": "The version of the component/asset.", - "inputMode": "combo", - "isConfidential": false, - "hasDynamicValueInformation": true, - "dependencyInputIds": [ - "connection", - "repository", - "group", - "artifact", - "defaultVersionType" - ], - "validation": { - "isRequired": true, - "dataType": "string", - "maxLength": 300 - }, - "properties": { - "visibleRule": "defaultVersionType == specificVersionType" - } - }, - { - "id": "packaging", - "name": "Packaging", - "description": "The Maven packaging for a component, which is jar by default. Other values as used in Maven and other build tools are ear, war, maven-plugin, pom, ejb, zip, tar.gz, aar and many others.", - "inputMode": "Combo", - "isConfidential": false, - "hasDynamicValueInformation": false, - "values": { - "defaultValue": "", - "possibleValues": [ - { - "value": "pom", - "displayValue": "pom" - }, - { - "value": "jar", - "displayValue": "jar" - }, - { - "value": "ejb", - "displayValue": "ejb" - }, - { - "value": "war", - "displayValue": "war" - }, - { - "value": "ear", - "displayValue": "ear" - }, - { - "value": "aar", - "displayValue": "aar" - }, - { - "value": "tar.gz", - "displayValue": "tar.gz" - }, - { - "value": "rar", - "displayValue": "rar" - }, - { - "value": "zip", - "displayValue": "zip" - }, - { - "value": "par", - "displayValue": "par" - }, - { - "value": "maven-archetype", - "displayValue": "maven-archetype" - }, - { - "value": "maven-plugin", - "displayValue": "maven-plugin" - } - ], - "isLimitedToPossibleValues": false - }, - "validation": { - "isRequired": true, - "dataType": "string", - "maxLength": 300 - } - }, - { - "id": "classifier", - "name": "Classifier", - "description": "The Maven classifier for a component. Common values are javadoc, sources or tests.", - "inputMode": "textbox", - "isConfidential": false, - "hasDynamicValueInformation": false, - "validation": { - "isRequired": false, - "dataType": "string", - "maxLength": 300 - } - }, - { - "id": "extension", - "name": "Extension", - "description": "The extension used for a specific asset of a component.", - "inputMode": "textbox", - "isConfidential": false, - "hasDynamicValueInformation": false, - "validation": { - "isRequired": false, - "dataType": "string", - "maxLength": 300 - } - } - ], - "taskInputMapping": { - - }, - "dataSourceBindings": [ - { - "target": "repository", - "endpointUrl":"{{{endpoint.url}}}service/local/all_repositories", - "resultSelector":"jsonpath:$.data[?(@.provider=='maven2')]", - "resultTemplate": "{ Value : \"{{{id}}}\", DisplayValue : \"{{{id}}}\" }" - }, - { - "target": "group", - "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{repository}}}&cn=maven", - "resultSelector":"jsonpath:$.data[*].groupId", - "resultTemplate": "{ Value : \"{{{defaultResultKey}}}\", DisplayValue : \"{{{defaultResultKey}}}\" }" - }, - { - "target": "artifact", - "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{repository}}}&g={{{group}}}", - "resultSelector":"jsonpath:$.data[*]", - "resultTemplate": "{ Value : \"{{{artifactId}}}\", DisplayValue : \"{{{artifactId}}}\" }" - }, - { - "target": "defaultVersionSpecific", - "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{repository}}}&g={{{group}}}&a={{{artifact}}}", - "resultSelector":"jsonpath:$.data[*]", - "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }" - }, - { - "target": "versions", - "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{repository}}}&g={{{group}}}&a={{{artifact}}}", - "resultSelector":"jsonpath:$.data[*]", - "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }" - }, - { - "target": "latestversion", - "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{repository}}}&g={{{group}}}&a={{{artifact}}}", - "resultSelector":"jsonpath:$.data[0]", - "resultTemplate": "{ Value : \"{{{latestRelease}}}\", DisplayValue : \"{{{latestRelease}}}\" }" - } - ], - "ArtifactTriggerConfiguration" : { - "isTriggerSupported": false - } - } - }, - { - "id": "nexus-build-release-task-v3", - "type": "ms.vss-distributed-task.task", - "targets": [ - "ms.vss-distributed-task.tasks" - ], - "properties": { - "name": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3" - } - }, - { - "id": "nexus-custom-release-artifact-type-v3", - "description": "Sonatype Nexus Repository v3 Artifact (Maven)", - "type": "ms.vss-releaseartifact.release-artifact-type", - "targets": [ - "ms.vss-releaseartifact.artifact-types" - ], - "properties": { - "name": "nexus-maven-repository-v3", - "displayName": "MavenRepoV3", - "endpointTypeId": "nexus", - "uniqueSourceIdentifier": "{{connection}}:{{repository}}:{{group}}:{{artifact}}", - "downloadTaskId": "6a26339d-ca44-4f1c-8511-fde5b7550a68", - "artifactType": "Package", - "inputDescriptors": [ - { - "id": "connection", - "name": "Service connection", - "description": "Nexus service connection", - "inputMode": "Combo", - "isConfidential": false, - "hasDynamicValueInformation": true, - "validation": { - "isRequired": true, - "dataType": "string", - "maxLength": 300 - } - }, - { - "id": "repository", - "name": "Repository Id", - "description": "Name of the Nexus repository in which to look for the component.", - "inputMode": "Combo", - "isConfidential": false, - "hasDynamicValueInformation": true, - "dependencyInputIds": [ - "connection" - ], - "validation": { - "isRequired": true, - "dataType": "string", - "maxLength": 300 - } - }, - { - "id": "group", - "name": "Group Id", - "description": "The Maven groupId for a component.", - "inputMode": "Combo", - "isConfidential": false, - "hasDynamicValueInformation": true, - "dependencyInputIds": [ - "connection", - "repository" - ], - "validation": { - "isRequired": true, - "dataType": "string", - "maxLength": 300 - } - }, - { - "id": "artifact", - "name": "Artifact Id", - "description": "The Maven artifactId for a component.", - "inputMode": "Combo", - "isConfidential": false, - "hasDynamicValueInformation": true, - "dependencyInputIds": [ - "connection", - "repository", - "group" - ], - "validation": { - "isRequired": true, - "dataType": "string", - "maxLength": 300 - } - }, - { - "id": "defaultVersionType", - "name": "Default Version", - "description": "The default version will be deployed when new releases are created. The version can be changed for manually created releases at the time of release creation.", - "inputMode": "Combo", - "isConfidential": false, - "hasDynamicValueInformation": false, - "values": { - "inputId": "defaultVersionTypeValues", - "defaultValue": "latestType", - "possibleValues": [ - { - "value": "latestType", - "displayValue": "Latest" - }, - { - "value": "specificVersionType", - "displayValue": "Specific version" - }, - { - "value": "selectDuringReleaseCreationType", - "displayValue": "Specify at the time of release creation" - } - ], - "isLimitedToPossibleValues": true - }, - "validation": { - "isRequired": true, - "dataType": "string" - } - }, - { - "id": "defaultVersionSpecific", - "name": "baseVersion", - "description": "The version of the component/asset.", - "inputMode": "combo", - "isConfidential": false, - "hasDynamicValueInformation": true, - "dependencyInputIds": [ - "connection", - "repository", - "group", - "artifact", - "defaultVersionType" - ], - "validation": { - "isRequired": true, - "dataType": "string", - "maxLength": 300 - }, - "properties": { - "visibleRule": "defaultVersionType == specificVersionType" - } - }, - { - "id": "packaging", - "name": "Packaging", - "description": "The Maven packaging for a component, which is jar by default. Other values as used in Maven and other build tools are ear, war, maven-plugin, pom, ejb, zip, tar.gz, aar and many others.", - "inputMode": "Combo", - "isConfidential": false, - "hasDynamicValueInformation": false, - "values": { - "defaultValue": "", - "possibleValues": [ - { - "value": "pom", - "displayValue": "pom" - }, - { - "value": "jar", - "displayValue": "jar" - }, - { - "value": "ejb", - "displayValue": "ejb" - }, - { - "value": "war", - "displayValue": "war" - }, - { - "value": "ear", - "displayValue": "ear" - }, - { - "value": "aar", - "displayValue": "aar" - }, - { - "value": "tar.gz", - "displayValue": "tar.gz" - }, - { - "value": "rar", - "displayValue": "rar" - }, - { - "value": "zip", - "displayValue": "zip" - }, - { - "value": "par", - "displayValue": "par" - }, - { - "value": "maven-archetype", - "displayValue": "maven-archetype" - }, - { - "value": "maven-plugin", - "displayValue": "maven-plugin" - } - ], - "isLimitedToPossibleValues": false - }, - "validation": { - "isRequired": true, - "dataType": "string", - "maxLength": 300 - } - }, - { - "id": "classifier", - "name": "Classifier", - "description": "The Maven classifier for a component. Common values are javadoc, sources or tests.", - "inputMode": "textbox", - "isConfidential": false, - "hasDynamicValueInformation": false, - "validation": { - "isRequired": false, - "dataType": "string", - "maxLength": 300 - } - }, - { - "id": "extension", - "name": "Extension", - "description": "The extension used for a specific asset of a component.", - "inputMode": "textbox", - "isConfidential": false, - "hasDynamicValueInformation": false, - "validation": { - "isRequired": false, - "dataType": "string", - "maxLength": 300 - } - } - ], - "taskInputMapping": { - - }, - "dataSourceBindings": [ - { - "target": "repository", - "endpointUrl":"{{{endpoint.url}}}service/rest/v1/repositories", - "resultSelector":"jsonpath:$.[?(@.format=='maven2')]", - "resultTemplate": "{ Value : \"{{{name}}}\", DisplayValue : \"{{{name}}}\" }" - }, - { - "target": "group", - "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{repository}}}{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", - "resultSelector":"jsonpath:$.items[*].group", - "resultTemplate": "{ Value : \"{{{defaultResultKey}}}\", DisplayValue : \"{{{defaultResultKey}}}\" }", - "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", - "callbackRequiredTemplate": "{{#equals continuationToken null}}false{{else}}true{{/equals}}", - "initialContextTemplate":"{\"continuationToken\" : null}" - }, - { - "target": "artifact", - "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{repository}}}&maven.groupId={{{group}}}{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", - "resultSelector":"jsonpath:$.items[*]", - "resultTemplate": "{ Value : \"{{{name}}}\", DisplayValue : \"{{{name}}}\" }", - "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", - "callbackRequiredTemplate": "{{#notEquals continuationToken null}}true{{/notEquals}}", - "initialContextTemplate":"{\"continuationToken\" : null}" - }, - { - "target": "defaultVersionSpecific", - "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{repository}}}&maven.groupId={{{group}}}&maven.artifactId={{{artifact}}}&sort=version{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", - "resultSelector":"jsonpath:$.items[*]", - "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }", - "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", - "callbackRequiredTemplate": "{{#notEquals continuationToken null}}true{{/notEquals}}", - "initialContextTemplate":"{\"continuationToken\" : null}" - }, - { - "target": "versions", - "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{repository}}}&maven.groupId={{{group}}}&maven.artifactId={{{artifact}}}&sort=version{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", - "resultSelector":"jsonpath:$.items[*]", - "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }", - "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", - "callbackRequiredTemplate": "{{#notEquals continuationToken null}}true{{/notEquals}}", - "initialContextTemplate":"{\"continuationToken\" : null}" - }, - { - "target": "latestversion", - "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{repository}}}&maven.groupId={{{group}}}&maven.artifactId={{{artifact}}}&sort=version", - "resultSelector":"jsonpath:$.items[0]", - "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }" - } - ], - "ArtifactTriggerConfiguration" : { - "isTriggerSupported": false - } - } - } - ], - "scopes": [], - "contributionTypes": [] -} \ No newline at end of file diff --git a/vss-extension-service.json b/vss-extension.json similarity index 97% rename from vss-extension-service.json rename to vss-extension.json index 21ee555..a08cf06 100644 --- a/vss-extension-service.json +++ b/vss-extension.json @@ -2,14 +2,14 @@ "manifestVersion": 1, "id": "nexus-custom-release-artifact-extension", "publisher": "soft-cor", - "version": "1.0.106", + "version": "1.0.107", "name": "Sonatype Nexus Repository Release Artifact", "description": "Add support for Sonatype Nexus Repository as an artifact for Release Pipelines", "public": true, "galleryFlags": [ ], - "categories": [ "Azure Pipelines" ], + "categories": [ "Build and release" ], "content": { "details": { "path": "overview.md" @@ -168,6 +168,16 @@ ] }, + { + "id": "nexus-build-release-taskV0_2", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2" + } + }, { "id": "nexus-build-release-task", "type": "ms.vss-distributed-task.task", @@ -453,14 +463,24 @@ } }, { - "id": "nexus-build-release-task-v3", + "id": "nexus-build-release-task-v0_3", "type": "ms.vss-distributed-task.task", "targets": [ "ms.vss-distributed-task.tasks" ], "properties": { - "name": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3" + "name": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3" } + }, + { + "id": "nexus-build-release-task-v3", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3" + } }, { "id": "nexus-custom-release-artifact-type-v3", From 2ab373dafb726bf4218eafd2aee19fbd65e122a9 Mon Sep 17 00:00:00 2001 From: Gareth Emslie Date: Wed, 8 Jul 2020 14:55:05 +0200 Subject: [PATCH 4/7] updates --- .../DownloadArtifactsNexusV0_2/task.json | 6 +- .../DownloadArtifactsNexusV0_3/task.json | 6 +- .../DownloadArtifactsNexusV2/task.json | 2 +- .../DownloadArtifactsNexusV3/task.json | 2 +- package.json | 6 +- vss-extension-server-2018.json | 754 ++++++++++++++++++ vss-extension.json | 29 +- 7 files changed, 772 insertions(+), 33 deletions(-) create mode 100644 vss-extension-server-2018.json diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/task.json b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/task.json index 7291788..a6958a9 100644 --- a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/task.json +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2/task.json @@ -15,9 +15,9 @@ "preview": false, "author": "soft-cor", "version": { - "Major": 0, - "Minor": 2, - "Patch": 49 + "Major": 2, + "Minor": 0, + "Patch": 50 }, "minimumAgentVersion": "2.144.0", "instanceNameFormat": "Download Artifacts - Nexus Maven Repository v2", diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/task.json b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/task.json index 69bb87e..b57a4b9 100644 --- a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/task.json +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3/task.json @@ -15,9 +15,9 @@ "preview": false, "author": "soft-cor", "version": { - "Major": 0, - "Minor": 3, - "Patch": 52 + "Major": 3, + "Minor": 0, + "Patch": 53 }, "minimumAgentVersion": "2.144.0", "instanceNameFormat": "Download Artifacts - Nexus Maven Repository v3", diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2/task.json b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2/task.json index 5efaaf5..ca4d82e 100644 --- a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2/task.json +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2/task.json @@ -17,7 +17,7 @@ "version": { "Major": 2, "Minor": 0, - "Patch": 49 + "Patch": 50 }, "minimumAgentVersion": "2.144.0", "instanceNameFormat": "Download Artifacts - Nexus Maven Repository v2", diff --git a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3/task.json b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3/task.json index be8228e..655c111 100644 --- a/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3/task.json +++ b/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3/task.json @@ -17,7 +17,7 @@ "version": { "Major": 3, "Minor": 0, - "Patch": 52 + "Patch": 53 }, "minimumAgentVersion": "2.144.0", "instanceNameFormat": "Download Artifacts - Nexus Maven Repository v3", diff --git a/package.json b/package.json index 065e7ca..fd673df 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,13 @@ { "scripts": { - "postinstall": "cd ./Tasks/DownloadArtifactsNexus && cd ./DownloadArtifactsNexusV2 && npm install && cd ../DownloadArtifactsNexusV3 && npm install", + "postinstall": "cd ./Tasks/DownloadArtifactsNexus && cd ./DownloadArtifactsNexusV2 && npm install && cd ../DownloadArtifactsNexusV3 && npm install && cd ../DownloadArtifactsNexusV0_2 && npm install && cd ../DownloadArtifactsNexusV0_3 && npm install", "build": "tsc", "package:DownloadArtifactsNexusV0_2": "(for %f in (task.json,package.json,icon.png) do xcopy /y /i .\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV0_2\\%f .\\dist\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV0_2\\) && cd ./dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2 && npm install --only=production", "package:DownloadArtifactsNexusV0_3": "(for %f in (task.json,package.json,icon.png) do xcopy /y /i .\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV0_3\\%f .\\dist\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV0_3\\) && cd ./dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3 && npm install --only=production", "package:DownloadArtifactsNexusV2": "(for %f in (task.json,package.json,icon.png) do xcopy /y /i .\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV2\\%f .\\dist\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV2\\) && cd ./dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2 && npm install --only=production", "package:DownloadArtifactsNexusV3": "(for %f in (task.json,package.json,icon.png) do xcopy /y /i .\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV3\\%f .\\dist\\Tasks\\DownloadArtifactsNexus\\DownloadArtifactsNexusV3\\) && cd ./dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3 && npm install --only=production", - "package": "npm run build && npm run package:DownloadArtifactsNexusV0_2 && npm run package:DownloadArtifactsNexusV0_3 && npm run package:DownloadArtifactsNexusV2 && npm run package:DownloadArtifactsNexusV3 && tfx extension create --manifests vss-extension.json --output-path ./dist/" + "package:Server2018VSIX": "npm run build && npm run package:DownloadArtifactsNexusV0_2 && npm run package:DownloadArtifactsNexusV0_3 && tfx extension create --manifests vss-extension-server-2018.json --output-path ./dist/", + "package:ServiceVSIX": "npm run build && npm run package:DownloadArtifactsNexusV2 && npm run package:DownloadArtifactsNexusV3 && tfx extension create --manifests vss-extension.json --output-path ./dist/", + "package": "npm run package:Server2018VSIX && npm run package:ServiceVSIX" } } diff --git a/vss-extension-server-2018.json b/vss-extension-server-2018.json new file mode 100644 index 0000000..6d222c7 --- /dev/null +++ b/vss-extension-server-2018.json @@ -0,0 +1,754 @@ +{ + "manifestVersion": 1, + "id": "nexus-custom-release-artifact-server-2018-extension", + "publisher": "soft-cor", + "version": "1.0.111", + "name": "Sonatype Nexus Repository Release Artifact", + "description": "Add support for Sonatype Nexus Repository as an artifact for Release Pipelines", + "public": true, + "galleryFlags": [ + + ], + "categories": [ "Build and release" ], + "content": { + "details": { + "path": "overview.md" + }, + "license": { + "path": "LICENSE" + } + }, + "links": { + "support": { + "uri": "https://blog.soft-cor.com" + } + }, + "repository": { + "type": "git", + "uri": "https://github.com/keyoke/NexusPipelineArtifact" + }, + "badges": [ + { + "href": "https://dev.azure.com/softcores/NexusPipelineArtifact/_build?definitionId=2&_a=summary", + "uri": "https://dev.azure.com/softcores/NexusPipelineArtifact/_apis/build/status/keyoke.NexusPipelineArtifact?branchName=master", + "description": "Azure Pipeline for NexusPipelineArtifact" + } + ], + "tags": [ + "Sonatype", + "Nexus", + "repository", + "manager", + "continuous", + "release", + "deploy", + "cd" + ], + "targets": [ + { + "id": "Microsoft.VisualStudio.Services" + } + ], + "demands": [ + "api-version/3.0" + ], + "icons": { + "default": "icon-nexus-logo.png" + }, + "screenshots": [ + { + "path": "images/screen1.png" + }, + { + "path": "images/screen2.png" + }, + { + "path": "images/screen3.png" + }, + { + "path": "images/screen4.png" + }, + { + "path": "images/screen5.png" + } + ], + "files": [ + { + "path": "images/screen1.png", + "addressable": true + }, + { + "path": "images/screen2.png", + "addressable": true + }, + { + "path": "images/screen3.png", + "addressable": true + }, + { + "path": "images/screen4.png", + "addressable": true + }, + { + "path": "images/screen5.png", + "addressable": true + }, + { + "path": "icon-nexus-logo.png", + "addressable": true + }, + { + "path": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2" + }, + { + "path": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3" + } + ], + "contributions": [ + { + "id": "nexus-endpoint-type", + "description": "Service connection type for Sonatype Nexus Repository", + "type": "ms.vss-endpoint.service-endpoint-type", + "targets": [ + "ms.vss-endpoint.endpoint-types" + ], + "properties": { + "name": "nexus", + "displayName": "Sonatype Nexus Repository", + "url": { + "displayName": "Repository URL" + }, + "authenticationSchemes": [ + { + "type": "ms.vss-endpoint.endpoint-auth-scheme-basic", + "inputDescriptors": [ + { + "id": "username", + "name": "Username", + "description": "Username for connecting to the endpoint", + "inputMode": "textbox", + "isConfidential": false, + "validation": { + "isRequired": true, + "dataType": "string" + } + }, + { + "id": "password", + "name": "Password", + "description": "Password for connecting to the endpoint", + "inputMode": "passwordBox", + "isConfidential": true, + "validation": { + "isRequired": true, + "dataType": "string" + } + } + ] + }, + { + "type": "ms.vss-endpoint.endpoint-auth-scheme-none" + } + ], + "inputDescriptors": [ + { + "id": "acceptUntrustedCerts", + "name": "Accept untrusted SSL certificates", + "description": "Allows self-signed SSL certificates.", + "inputMode": "checkbox", + "isConfidential": false, + "validation": { + "isRequired": false, + "dataType": "boolean" + } + } + ], + "dataSources": [ + + ] + }, + "constraints": [ + + ] + }, + { + "id": "nexus-build-release-task", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2" + } + }, + { + "id": "nexus-custom-release-artifact-type", + "description": "Sonatype Nexus Repository v2 Maven Artifact", + "type": "ms.vss-releaseartifact.release-artifact-type", + "targets": [ + "ms.vss-releaseartifact.artifact-types" + ], + "properties": { + "name": "nexus-maven-repository", + "displayName": "MavenRepoV2", + "endpointTypeId": "nexus", + "uniqueSourceIdentifier": "{{connection}}:{{definition}}:{{group}}:{{artifact}}", + "downloadTaskId": "a843bbfd-4ced-4e8d-8102-cf2f193ee283", + "artifactType": "Package", + "inputDescriptors": [ + { + "id": "connection", + "name": "Service connection", + "description": "Nexus service connection", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "definition", + "name": "Repository Id", + "description": "Name of the Nexus repository in which to look for the component.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "group", + "name": "Group Id", + "description": "The Maven groupId for a component.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection", + "definition" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "artifact", + "name": "Artifact Id", + "description": "The Maven artifactId for a component.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection", + "definition", + "group" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "defaultVersionType", + "name": "Default Version", + "description": "The default version will be deployed when new releases are created. The version can be changed for manually created releases at the time of release creation.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": false, + "values": { + "inputId": "defaultVersionTypeValues", + "defaultValue": "latestType", + "possibleValues": [ + { + "value": "latestType", + "displayValue": "Latest" + }, + { + "value": "specificVersionType", + "displayValue": "Specific version" + }, + { + "value": "selectDuringReleaseCreationType", + "displayValue": "Specify at the time of release creation" + } + ], + "isLimitedToPossibleValues": true + }, + "validation": { + "isRequired": true, + "dataType": "string" + } + }, + { + "id": "defaultVersionSpecific", + "name": "Version", + "description": "The version of the component/asset.", + "inputMode": "combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection", + "definition", + "group", + "artifact", + "defaultVersionType" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + }, + "properties": { + "visibleRule": "defaultVersionType == specificVersionType" + } + }, + { + "id": "packaging", + "name": "Packaging", + "description": "The Maven packaging for a component, which is jar by default. Other values as used in Maven and other build tools are ear, war, maven-plugin, pom, ejb, zip, tar.gz, aar and many others.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": false, + "values": { + "defaultValue": "", + "possibleValues": [ + { + "value": "pom", + "displayValue": "pom" + }, + { + "value": "jar", + "displayValue": "jar" + }, + { + "value": "ejb", + "displayValue": "ejb" + }, + { + "value": "war", + "displayValue": "war" + }, + { + "value": "ear", + "displayValue": "ear" + }, + { + "value": "aar", + "displayValue": "aar" + }, + { + "value": "tar.gz", + "displayValue": "tar.gz" + }, + { + "value": "rar", + "displayValue": "rar" + }, + { + "value": "zip", + "displayValue": "zip" + }, + { + "value": "par", + "displayValue": "par" + }, + { + "value": "maven-archetype", + "displayValue": "maven-archetype" + }, + { + "value": "maven-plugin", + "displayValue": "maven-plugin" + } + ], + "isLimitedToPossibleValues": false + }, + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "classifier", + "name": "Classifier", + "description": "The Maven classifier for a component. Common values are javadoc, sources or tests.", + "inputMode": "textbox", + "isConfidential": false, + "hasDynamicValueInformation": false, + "validation": { + "isRequired": false, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "extension", + "name": "Extension", + "description": "The extension used for a specific asset of a component.", + "inputMode": "textbox", + "isConfidential": false, + "hasDynamicValueInformation": false, + "validation": { + "isRequired": false, + "dataType": "string", + "maxLength": 300 + } + } + ], + "taskInputMapping": { + + }, + "dataSourceBindings": [ + { + "target": "definition", + "endpointUrl":"{{{endpoint.url}}}service/local/all_repositories", + "resultSelector":"jsonpath:$.data[?(@.provider=='maven2')]", + "resultTemplate": "{ Value : \"{{{id}}}\", DisplayValue : \"{{{id}}}\" }" + }, + { + "target": "group", + "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{definition}}}&cn=maven", + "resultSelector":"jsonpath:$.data[*].groupId", + "resultTemplate": "{ Value : \"{{{defaultResultKey}}}\", DisplayValue : \"{{{defaultResultKey}}}\" }" + }, + { + "target": "artifact", + "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{definition}}}&g={{{group}}}", + "resultSelector":"jsonpath:$.data[*]", + "resultTemplate": "{ Value : \"{{{artifactId}}}\", DisplayValue : \"{{{artifactId}}}\" }" + }, + { + "target": "defaultVersionSpecific", + "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{definition}}}&g={{{group}}}&a={{{artifact}}}", + "resultSelector":"jsonpath:$.data[*]", + "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }" + }, + { + "target": "versions", + "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{definition}}}&g={{{group}}}&a={{{artifact}}}", + "resultSelector":"jsonpath:$.data[*]", + "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }" + }, + { + "target": "latestversion", + "endpointUrl":"{{{endpoint.url}}}service/local/lucene/search?repositoryId={{{definition}}}&g={{{group}}}&a={{{artifact}}}", + "resultSelector":"jsonpath:$.data[0]", + "resultTemplate": "{ Value : \"{{{latestRelease}}}\", DisplayValue : \"{{{latestRelease}}}\" }" + } + ], + "ArtifactTriggerConfiguration" : { + "isTriggerSupported": false + } + } + }, + { + "id": "nexus-build-release-task-v3", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3" + } + }, + { + "id": "nexus-custom-release-artifact-type-v3", + "description": "Sonatype Nexus Repository v3 Artifact (Maven)", + "type": "ms.vss-releaseartifact.release-artifact-type", + "targets": [ + "ms.vss-releaseartifact.artifact-types" + ], + "properties": { + "name": "nexus-maven-repository-v3", + "displayName": "MavenRepoV3", + "endpointTypeId": "nexus", + "uniqueSourceIdentifier": "{{connection}}:{{definition}}:{{group}}:{{artifact}}", + "downloadTaskId": "6a26339d-ca44-4f1c-8511-fde5b7550a68", + "artifactType": "Package", + "inputDescriptors": [ + { + "id": "connection", + "name": "Service connection", + "description": "Nexus service connection", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "definition", + "name": "Repository Id", + "description": "Name of the Nexus repository in which to look for the component.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "group", + "name": "Group Id", + "description": "The Maven groupId for a component.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection", + "definition" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "artifact", + "name": "Artifact Id", + "description": "The Maven artifactId for a component.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection", + "definition", + "group" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "defaultVersionType", + "name": "Default Version", + "description": "The default version will be deployed when new releases are created. The version can be changed for manually created releases at the time of release creation.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": false, + "values": { + "inputId": "defaultVersionTypeValues", + "defaultValue": "latestType", + "possibleValues": [ + { + "value": "latestType", + "displayValue": "Latest" + }, + { + "value": "specificVersionType", + "displayValue": "Specific version" + }, + { + "value": "selectDuringReleaseCreationType", + "displayValue": "Specify at the time of release creation" + } + ], + "isLimitedToPossibleValues": true + }, + "validation": { + "isRequired": true, + "dataType": "string" + } + }, + { + "id": "defaultVersionSpecific", + "name": "Version", + "description": "The version of the component/asset.", + "inputMode": "combo", + "isConfidential": false, + "hasDynamicValueInformation": true, + "dependencyInputIds": [ + "connection", + "definition", + "group", + "artifact", + "defaultVersionType" + ], + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + }, + "properties": { + "visibleRule": "defaultVersionType == specificVersionType" + } + }, + { + "id": "packaging", + "name": "Packaging", + "description": "The Maven packaging for a component, which is jar by default. Other values as used in Maven and other build tools are ear, war, maven-plugin, pom, ejb, zip, tar.gz, aar and many others.", + "inputMode": "Combo", + "isConfidential": false, + "hasDynamicValueInformation": false, + "values": { + "defaultValue": "", + "possibleValues": [ + { + "value": "pom", + "displayValue": "pom" + }, + { + "value": "jar", + "displayValue": "jar" + }, + { + "value": "ejb", + "displayValue": "ejb" + }, + { + "value": "war", + "displayValue": "war" + }, + { + "value": "ear", + "displayValue": "ear" + }, + { + "value": "aar", + "displayValue": "aar" + }, + { + "value": "tar.gz", + "displayValue": "tar.gz" + }, + { + "value": "rar", + "displayValue": "rar" + }, + { + "value": "zip", + "displayValue": "zip" + }, + { + "value": "par", + "displayValue": "par" + }, + { + "value": "maven-archetype", + "displayValue": "maven-archetype" + }, + { + "value": "maven-plugin", + "displayValue": "maven-plugin" + } + ], + "isLimitedToPossibleValues": false + }, + "validation": { + "isRequired": true, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "classifier", + "name": "Classifier", + "description": "The Maven classifier for a component. Common values are javadoc, sources or tests.", + "inputMode": "textbox", + "isConfidential": false, + "hasDynamicValueInformation": false, + "validation": { + "isRequired": false, + "dataType": "string", + "maxLength": 300 + } + }, + { + "id": "extension", + "name": "Extension", + "description": "The extension used for a specific asset of a component.", + "inputMode": "textbox", + "isConfidential": false, + "hasDynamicValueInformation": false, + "validation": { + "isRequired": false, + "dataType": "string", + "maxLength": 300 + } + } + ], + "taskInputMapping": { + }, + "dataSourceBindings": [ + { + "target": "definition", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/repositories", + "resultSelector":"jsonpath:$.[?(@.format=='maven2')]", + "resultTemplate": "{ Value : \"{{{name}}}\", DisplayValue : \"{{{name}}}\" }" + }, + { + "target": "group", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{definition}}}{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", + "resultSelector":"jsonpath:$.items[*].group", + "resultTemplate": "{ Value : \"{{{defaultResultKey}}}\", DisplayValue : \"{{{defaultResultKey}}}\" }", + "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", + "callbackRequiredTemplate": "{{#equals continuationToken null}}false{{else}}true{{/equals}}", + "initialContextTemplate":"{\"continuationToken\" : null}" + }, + { + "target": "artifact", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{definition}}}&maven.groupId={{{group}}}{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", + "resultSelector":"jsonpath:$.items[*]", + "resultTemplate": "{ Value : \"{{{name}}}\", DisplayValue : \"{{{name}}}\" }", + "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", + "callbackRequiredTemplate": "{{#notEquals continuationToken null}}true{{/notEquals}}", + "initialContextTemplate":"{\"continuationToken\" : null}" + }, + { + "target": "defaultVersionSpecific", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{definition}}}&maven.groupId={{{group}}}&maven.artifactId={{{artifact}}}&sort=version{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", + "resultSelector":"jsonpath:$.items[*]", + "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }", + "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", + "callbackRequiredTemplate": "{{#notEquals continuationToken null}}true{{/notEquals}}", + "initialContextTemplate":"{\"continuationToken\" : null}" + }, + { + "target": "versions", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{definition}}}&maven.groupId={{{group}}}&maven.artifactId={{{artifact}}}&sort=version{{#notEquals continuationToken null}}&continuationToken={{{continuationToken}}}{{/notEquals}}", + "resultSelector":"jsonpath:$.items[*]", + "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }", + "callbackContextTemplate": "{\"continuationToken\" : \"{{{continuationToken}}}\"}", + "callbackRequiredTemplate": "{{#notEquals continuationToken null}}true{{/notEquals}}", + "initialContextTemplate":"{\"continuationToken\" : null}" + }, + { + "target": "latestversion", + "endpointUrl":"{{{endpoint.url}}}service/rest/v1/search?repository={{{definition}}}&maven.groupId={{{group}}}&maven.artifactId={{{artifact}}}&sort=version", + "resultSelector":"jsonpath:$.items[0]", + "resultTemplate": "{ Value : \"{{{version}}}\", DisplayValue : \"{{{version}}}\" }" + } + ], + "ArtifactTriggerConfiguration" : { + "isTriggerSupported": false + } + } + } + ], + "scopes": [], + "contributionTypes": [] +} \ No newline at end of file diff --git a/vss-extension.json b/vss-extension.json index a08cf06..65a6319 100644 --- a/vss-extension.json +++ b/vss-extension.json @@ -2,14 +2,14 @@ "manifestVersion": 1, "id": "nexus-custom-release-artifact-extension", "publisher": "soft-cor", - "version": "1.0.107", + "version": "1.0.111", "name": "Sonatype Nexus Repository Release Artifact", "description": "Add support for Sonatype Nexus Repository as an artifact for Release Pipelines", "public": true, "galleryFlags": [ ], - "categories": [ "Build and release" ], + "categories": [ "Azure Pipelines" ], "content": { "details": { "path": "overview.md" @@ -98,7 +98,10 @@ "addressable": true }, { - "path": "dist/Tasks/DownloadArtifactsNexus" + "path": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV2" + }, + { + "path": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV3" } ], "contributions": [ @@ -168,16 +171,6 @@ ] }, - { - "id": "nexus-build-release-taskV0_2", - "type": "ms.vss-distributed-task.task", - "targets": [ - "ms.vss-distributed-task.tasks" - ], - "properties": { - "name": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_2" - } - }, { "id": "nexus-build-release-task", "type": "ms.vss-distributed-task.task", @@ -462,16 +455,6 @@ } } }, - { - "id": "nexus-build-release-task-v0_3", - "type": "ms.vss-distributed-task.task", - "targets": [ - "ms.vss-distributed-task.tasks" - ], - "properties": { - "name": "dist/Tasks/DownloadArtifactsNexus/DownloadArtifactsNexusV0_3" - } - }, { "id": "nexus-build-release-task-v3", "type": "ms.vss-distributed-task.task", From 9975bc61fa3c2a3bbc26b100ea8a75ca06ab0917 Mon Sep 17 00:00:00 2001 From: Gareth Emslie Date: Wed, 8 Jul 2020 14:57:25 +0200 Subject: [PATCH 5/7] update pipeline --- azure-pipelines.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml index 0f944e4..99ec5fc 100644 --- a/azure-pipelines.yaml +++ b/azure-pipelines.yaml @@ -26,8 +26,11 @@ stages: - script: npm install displayName: 'Install Dependencies' - script: | - npm run package -- --override {\"version\": \"$(MajorVersion).$(MinorVersion).$(PatchVersion)\"} - displayName: 'Build & Package' + npm run package:Server2018VSIX -- --override {\"version\": \"$(MajorVersion).$(MinorVersion).$(PatchVersion)\"} + displayName: 'Build & Package Server' + - script: | + npm run package:ServiceVSIX -- --override {\"version\": \"$(MajorVersion).$(MinorVersion).$(PatchVersion)\"} + displayName: 'Build & Package Service' - task: PowerShell@2 displayName: 'Tag Git Commit' inputs: From daa80b715fcd84d91f5a2371fefa082a13cdf0d5 Mon Sep 17 00:00:00 2001 From: Gareth Emslie Date: Wed, 8 Jul 2020 14:58:14 +0200 Subject: [PATCH 6/7] fix yaml whitespace --- azure-pipelines.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yaml b/azure-pipelines.yaml index 99ec5fc..aef1a28 100644 --- a/azure-pipelines.yaml +++ b/azure-pipelines.yaml @@ -26,7 +26,7 @@ stages: - script: npm install displayName: 'Install Dependencies' - script: | - npm run package:Server2018VSIX -- --override {\"version\": \"$(MajorVersion).$(MinorVersion).$(PatchVersion)\"} + npm run package:Server2018VSIX -- --override {\"version\": \"$(MajorVersion).$(MinorVersion).$(PatchVersion)\"} displayName: 'Build & Package Server' - script: | npm run package:ServiceVSIX -- --override {\"version\": \"$(MajorVersion).$(MinorVersion).$(PatchVersion)\"} From 859d4bbb98d838b2de661f0ffa62d6edfe164d42 Mon Sep 17 00:00:00 2001 From: Gareth Emslie Date: Wed, 8 Jul 2020 15:10:22 +0200 Subject: [PATCH 7/7] update targets and demands --- vss-extension-server-2018.json | 5 +++-- vss-extension.json | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/vss-extension-server-2018.json b/vss-extension-server-2018.json index 6d222c7..a617e94 100644 --- a/vss-extension-server-2018.json +++ b/vss-extension-server-2018.json @@ -46,11 +46,12 @@ ], "targets": [ { - "id": "Microsoft.VisualStudio.Services" + "id": "Microsoft.TeamFoundation.Server", + "version": "[16.0]" } ], "demands": [ - "api-version/3.0" + "api-version/4.0" ], "icons": { "default": "icon-nexus-logo.png" diff --git a/vss-extension.json b/vss-extension.json index 65a6319..8f5e553 100644 --- a/vss-extension.json +++ b/vss-extension.json @@ -46,11 +46,15 @@ ], "targets": [ { - "id": "Microsoft.VisualStudio.Services" + "id": "Microsoft.VisualStudio.Services.Cloud" + }, + { + "id": "Microsoft.TeamFoundation.Server", + "version": "[17.0,)" } ], "demands": [ - "api-version/3.0" + "api-version/5.0" ], "icons": { "default": "icon-nexus-logo.png"