Skip to content

Commit

Permalink
Merge pull request #2 from Microsoft/releases/m141
Browse files Browse the repository at this point in the history
Releases/m141
  • Loading branch information
puagarwa authored Oct 9, 2018
2 parents 4eec77f + 4f30328 commit 9d98fbd
Show file tree
Hide file tree
Showing 18 changed files with 106 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
"loc.messages.LegacyPlatform": "Detected platform (Legacy): %s",
"loc.messages.WarningVersionNotFound": "Could not fetch download information for version %s. Please check if the version specified is correct. You can refer the link for supported versions => https://github.com/dotnet/core/blob/master/release-notes/releases.json. Falling back to creating convention based URL.",
"loc.messages.CouldNotDownload": "Could not download installation package from this URL: %s Error: %s",
"loc.messages.FailedToDownloadPackage": "Failed to download package for installation"
"loc.messages.FailedToDownloadPackage": "Failed to download package for installation",
"loc.messages.PrependGlobalToolPath": "Creating global tool path and pre-prending to PATH."
}
15 changes: 15 additions & 0 deletions Tasks/DotNetCoreInstallerV0/dotnetcoreinstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ class DotnetCoreInstaller {
// Prepend the tools path. instructs the agent to prepend for future tasks
toolLib.prependPath(toolPath);

try {
let globalToolPath: string = "";
if (tl.osType().match(/^Win/)) {
globalToolPath = path.join(process.env.USERPROFILE, ".dotnet\\tools");
} else {
globalToolPath = path.join(process.env.HOME, ".dotnet/tools");
}

console.log(tl.loc("PrependGlobalToolPath"));
tl.mkdirP(globalToolPath);
toolLib.prependPath(globalToolPath);
} catch (error) {
//nop
}

// Set DOTNET_ROOT for dotnet core Apphost to find runtime since it is installed to a non well-known location.
tl.setVariable('DOTNET_ROOT', toolPath);
}
Expand Down
18 changes: 13 additions & 5 deletions Tasks/DotNetCoreInstallerV0/releasesfetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,22 @@ export class DotNetCoreReleaseFetcher {
let blobUrl: string = release['blob-' + type];
let dlcUrl: string = release['dlc-' + type];
let fileName: string = release[type + '-' + osSuffixes[0]] ? release[type + '-' + osSuffixes[0]] : release[type + '-' + osSuffixes[1]];
fileName = fileName.trim();

if (!!fileName) {
if (!!blobUrl) {
downloadUrls.push(util.format("%s%s", blobUrl.trim(), fileName.trim()));
}
// For some latest version, the filename itself can be full download url.
// Do a very basic check for url(instead of regex) as the url is only for downloading and
// is coming from .net core releases json and not some ransom user input
if (fileName.toLowerCase().startsWith("https://")) {
downloadUrls.push(fileName);
} else {
if (!!blobUrl) {
downloadUrls.push(util.format("%s%s", blobUrl.trim(), fileName));
}

if (!!dlcUrl) {
downloadUrls.push(util.format("%s%s", dlcUrl.trim(), fileName.trim()));
if (!!dlcUrl) {
downloadUrls.push(util.format("%s%s", dlcUrl.trim(), fileName));
}
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions Tasks/DotNetCoreInstallerV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 1,
"Patch": 13
"Patch": 16
},
"satisfies": [
"DotNetCore"
Expand Down Expand Up @@ -67,6 +67,7 @@
"LegacyPlatform": "Detected platform (Legacy): %s",
"WarningVersionNotFound": "Could not fetch download information for version %s. Please check if the version specified is correct. You can refer the link for supported versions => https://github.com/dotnet/core/blob/master/release-notes/releases.json. Falling back to creating convention based URL.",
"CouldNotDownload": "Could not download installation package from this URL: %s Error: %s",
"FailedToDownloadPackage": "Failed to download package for installation"
"FailedToDownloadPackage": "Failed to download package for installation",
"PrependGlobalToolPath": "Creating global tool path and pre-prending to PATH."
}
}
5 changes: 3 additions & 2 deletions Tasks/DotNetCoreInstallerV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 1,
"Patch": 13
"Patch": 16
},
"satisfies": [
"DotNetCore"
Expand Down Expand Up @@ -67,6 +67,7 @@
"LegacyPlatform": "ms-resource:loc.messages.LegacyPlatform",
"WarningVersionNotFound": "ms-resource:loc.messages.WarningVersionNotFound",
"CouldNotDownload": "ms-resource:loc.messages.CouldNotDownload",
"FailedToDownloadPackage": "ms-resource:loc.messages.FailedToDownloadPackage"
"FailedToDownloadPackage": "ms-resource:loc.messages.FailedToDownloadPackage",
"PrependGlobalToolPath": "ms-resource:loc.messages.PrependGlobalToolPath"
}
}
2 changes: 1 addition & 1 deletion Tasks/NuGetCommandV2/Common/VstsNuGetPushToolUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as path from "path";
import * as commandHelper from "nuget-task-common/CommandHelper";

export function getBundledVstsNuGetPushLocation(): string {
const vstsNuGetPushPaths: string[] = ["VstsNuGetPush/0.13.0"];
const vstsNuGetPushPaths: string[] = ["VstsNuGetPush/0.17.0/tools"];

const toolPath = commandHelper.locateTool("VstsNuGetPush",
<commandHelper.LocateOptions>{
Expand Down
4 changes: 4 additions & 0 deletions Tasks/NuGetCommandV2/make.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
],
"externals": {
"archivePackages": [
{
"url": "https://vstsagenttools.blob.core.windows.net/tools/VstsNuGetPush/0.17.0/microsoft.visualstudio.services.packaging.nuget.pushtool.0.17.0.zip",
"dest": "./VstsNuGetPush/0.17.0/"
},
{
"url": "https://vstsagenttools.blob.core.windows.net/tools/VstsNuGetPush/0.13.0/microsoft.visualstudio.services.packaging.nuget.pushtool.0.13.0.zip",
"dest": "./VstsNuGetPush/0.13.0/"
Expand Down
2 changes: 1 addition & 1 deletion Tasks/NuGetCommandV2/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Tasks/NuGetCommandV2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nugetcommand",
"version": "2.0.41",
"version": "2.0.45",
"description": "Restore, pack, or push NuGet packages, or run a NuGet command.",
"main": "nugetcommandmain.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion Tasks/NuGetCommandV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"version": {
"Major": 2,
"Minor": 0,
"Patch": 41
"Patch": 45
},
"runsOn": [
"Agent",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/NuGetCommandV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"version": {
"Major": 2,
"Minor": 0,
"Patch": 40
"Patch": 45
},
"runsOn": [
"Agent",
Expand Down
17 changes: 17 additions & 0 deletions Tasks/PackerBuildV0/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ function runValidations(validator: () => void, tr, done) {
describe('PackerBuild Suite', function() {
this.timeout(30000);
before((done) => {

delete process.env["__build_output__"] ;
delete process.env["__copy_fails__"] ;
delete process.env["__deploy_package_found__"] ;
delete process.env["__dest_path_exists__"] ;
delete process.env["__download_fails__"] ;
delete process.env["__extract_fails__"] ;
delete process.env["__lower_version__"] ;
delete process.env["__no_output_vars__"] ;
delete process.env["__ostype__"] ;
delete process.env["__packer_build_fails__"] ;
delete process.env["__packer_build_no_output__"] ;
delete process.env["__packer_exists__"] ;
delete process.env["__packer_fix_fails__"] ;
delete process.env["__packer_validate_fails__"] ;
delete process.env["__spnObjectId_not_exists__"] ;

done();
});
after(function () {
Expand Down
19 changes: 18 additions & 1 deletion Tasks/PackerBuildV1/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,26 @@ function runValidations(validator: () => void, tr, done) {
}
}

describe('PackerBuild Suite', function() {
describe('PackerBuild Suite V1', function() {
this.timeout(30000);
before((done) => {

delete process.env["__build_output__"] ;
delete process.env["__copy_fails__"] ;
delete process.env["__deploy_package_found__"] ;
delete process.env["__dest_path_exists__"] ;
delete process.env["__download_fails__"] ;
delete process.env["__extract_fails__"] ;
delete process.env["__lower_version__"] ;
delete process.env["__no_output_vars__"] ;
delete process.env["__ostype__"] ;
delete process.env["__packer_build_fails__"] ;
delete process.env["__packer_build_no_output__"] ;
delete process.env["__packer_exists__"] ;
delete process.env["__packer_fix_fails__"] ;
delete process.env["__packer_validate_fails__"] ;
delete process.env["__spnObjectId_not_exists__"] ;

done();
});
after(function () {
Expand Down
35 changes: 19 additions & 16 deletions Tasks/PackerBuildV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,6 @@
},
"defaultValue": "builtin"
},
{
"name": "isManagedImage",
"type": "boolean",
"label": "ms-resource:loc.input.label.isManagedImage",
"required": true,
"helpMarkDown": "ms-resource:loc.input.help.isManagedImage",
"defaultValue": true
},
{
"name": "managedImageName",
"type": "string",
"label": "ms-resource:loc.input.label.managedImageName",
"required": true,
"helpMarkDown": "ms-resource:loc.input.help.managedImageName",
"visibleRule": "isManagedImage = true && templateType = builtin"
},
{
"name": "customTemplateLocation",
"type": "filePath",
Expand Down Expand Up @@ -101,6 +85,24 @@
"helpMarkDown": "ms-resource:loc.input.help.ConnectedServiceName",
"groupName": "AzureDetails"
},
{
"name": "isManagedImage",
"type": "boolean",
"label": "ms-resource:loc.input.label.isManagedImage",
"required": true,
"helpMarkDown": "ms-resource:loc.input.help.isManagedImage",
"defaultValue": true,
"groupName": "AzureDetails"
},
{
"name": "managedImageName",
"type": "string",
"label": "ms-resource:loc.input.label.managedImageName",
"required": true,
"helpMarkDown": "ms-resource:loc.input.help.managedImageName",
"visibleRule": "isManagedImage = true",
"groupName": "AzureDetails"
},
{
"name": "location",
"type": "pickList",
Expand Down Expand Up @@ -293,6 +295,7 @@
"PackerBuildCompleted": "ms-resource:loc.messages.PackerBuildCompleted",
"ImageURIOutputVariableNotFound": "ms-resource:loc.messages.ImageURIOutputVariableNotFound",
"ManagedImageNameOutputVariableNotFound": "ms-resource:loc.messages.ManagedImageNameOutputVariableNotFound",
"CustumTemplateOutputVariableNotFound": "ms-resource:loc.messages.CustumTemplateOutputVariableNotFound",
"BuiltInTemplateNotFoundErrorMessagePathName": "ms-resource:loc.messages.BuiltInTemplateNotFoundErrorMessagePathName",
"CustomTemplateNotFoundErrorMessagePathName": "ms-resource:loc.messages.CustomTemplateNotFoundErrorMessagePathName",
"CouldNotDeleteTemporaryTemplateDirectory": "ms-resource:loc.messages.CouldNotDeleteTemporaryTemplateDirectory",
Expand Down
4 changes: 2 additions & 2 deletions Tasks/PublishTestResultsV2/make.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"externals": {
"archivePackages": [
{
"url": "https://publishtestresults.blob.core.windows.net/publishtestresults/7274955/PublishTestResults.zip",
"url": "https://publishtestresults.blob.core.windows.net/publishtestresults/7340655/PublishTestResults.zip",
"dest": "./"
}
]
}
}
}
4 changes: 2 additions & 2 deletions Tasks/PublishTestResultsV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 2,
"Minor": 0,
"Patch": 11
"Patch": 12
},
"demands": [],
"releaseNotes": "<ul><li>NUnit3 support</li><li>Support for Minimatch files pattern</li></ul>",
Expand Down Expand Up @@ -124,4 +124,4 @@
"NoMatchingFilesFound": "No test result files matching '%s' were found.",
"ErrorTestResultsPublisher": "Error while executing TestResultsPublisher: %s."
}
}
}
4 changes: 2 additions & 2 deletions Tasks/PublishTestResultsV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 2,
"Minor": 0,
"Patch": 11
"Patch": 12
},
"demands": [],
"releaseNotes": "ms-resource:loc.releaseNotes",
Expand Down Expand Up @@ -115,4 +115,4 @@
"NoMatchingFilesFound": "ms-resource:loc.messages.NoMatchingFilesFound",
"ErrorTestResultsPublisher": "ms-resource:loc.messages.ErrorTestResultsPublisher"
}
}
}
1 change: 1 addition & 0 deletions make-options.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"NuGetPublisherV0",
"NuGetToolInstallerV0",
"PackerBuildV0",
"PackerBuildV1",
"PowerShellV2",
"PowerShellOnTargetMachinesV2",
"PowerShellOnTargetMachinesV3",
Expand Down

0 comments on commit 9d98fbd

Please sign in to comment.