From d7378ded4c6340c13e0a50aa94897a157cc3f3c3 Mon Sep 17 00:00:00 2001 From: Daniel Johansen Date: Thu, 11 Jun 2020 13:53:48 +0200 Subject: [PATCH] Fix for installing aws.lambda.tools along side nuget.config with private feed. This change will always allow aws.lambda.tools to be installed in the buildpipeline regardless of the presence of a private feed in the nuget config. --- ...-0d02e676-f277-4883-bea5-70eb36a76cef.json | 4 ++++ Tasks/Common/dotNetCliWrapper.ts | 20 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .changes/next-release/Bug Fix-0d02e676-f277-4883-bea5-70eb36a76cef.json diff --git a/.changes/next-release/Bug Fix-0d02e676-f277-4883-bea5-70eb36a76cef.json b/.changes/next-release/Bug Fix-0d02e676-f277-4883-bea5-70eb36a76cef.json new file mode 100644 index 00000000..eab9fa17 --- /dev/null +++ b/.changes/next-release/Bug Fix-0d02e676-f277-4883-bea5-70eb36a76cef.json @@ -0,0 +1,4 @@ +{ + "type": "Bug Fix", + "description": "Fix for installing aws.lambda.tools along side nuget.config with private nuget-feed." +} diff --git a/Tasks/Common/dotNetCliWrapper.ts b/Tasks/Common/dotNetCliWrapper.ts index 80ad1abf..8666ebdf 100644 --- a/Tasks/Common/dotNetCliWrapper.ts +++ b/Tasks/Common/dotNetCliWrapper.ts @@ -48,7 +48,15 @@ export class DotNetCliWrapper { private async updateGlobalTools(): Promise { try { - const returnCode = await this.execute(['tool', 'update', '-g', 'Amazon.Lambda.Tools'], '') + const returnCode = await this.execute( + [ + 'tool', + 'update', + "-g --ignore-failed-sourced --add-source https://api.nuget.org/v3/index.json --version '*'", + 'Amazon.Lambda.Tools' + ], + '' + ) if (returnCode === 0) { return true } else { @@ -65,7 +73,15 @@ export class DotNetCliWrapper { private async installGlobalTools(): Promise { try { - const returnCode = await this.execute(['tool', 'install', '-g', 'Amazon.Lambda.Tools'], '') + const returnCode = await this.execute( + [ + 'tool', + 'install', + "-g --ignore-failed-sourced --add-source https://api.nuget.org/v3/index.json --version '*'", + 'Amazon.Lambda.Tools' + ], + '' + ) if (returnCode === 0) { return true } else {