From 9ed8bbbc6369aa692fa37e82015bbb330382e56d Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Tue, 7 Jul 2020 08:37:15 +0000 Subject: [PATCH] Add Newman tool (#1185) * Add Newman * Move installation to NodeLts script on Windows --- images/linux/scripts/installers/nodejs.sh | 5 +++-- images/win/scripts/Installers/Install-NodeLts.ps1 | 1 + images/win/scripts/Installers/Validate-NodeLts.ps1 | 10 ++++++++++ .../SoftwareReport/SoftwareReport.Generator.ps1 | 1 + .../scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 4 ++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/installers/nodejs.sh b/images/linux/scripts/installers/nodejs.sh index 5b4777a6f..073061ed5 100644 --- a/images/linux/scripts/installers/nodejs.sh +++ b/images/linux/scripts/installers/nodejs.sh @@ -10,7 +10,7 @@ source $HELPER_SCRIPTS/document.sh # Install LTS Node.js and related build tools curl -sL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s -- -ny - ~/n/bin/n lts -npm install -g grunt gulp n parcel-bundler typescript +npm install -g grunt gulp n parcel-bundler typescript newman npm install -g --save-dev webpack webpack-cli npm install -g npm rm -rf ~/n @@ -25,7 +25,7 @@ apt-get install -y --no-install-recommends yarn # Run tests to determine that the software installed as expected echo "Testing to make sure that script performed as expected, and basic scenarios work" -for cmd in node grunt gulp webpack parcel yarn; do +for cmd in node grunt gulp webpack parcel yarn newman; do if ! command -v $cmd; then echo "$cmd was not installed" exit 1 @@ -43,3 +43,4 @@ DocumentInstalledItem "TypeScript ($(tsc --version))" DocumentInstalledItem "Webpack ($(webpack --version))" DocumentInstalledItem "Webpack CLI ($(webpack-cli --version))" DocumentInstalledItem "Yarn ($(yarn --version))" +DocumentInstalledItem "Newman ($(newman --version))" diff --git a/images/win/scripts/Installers/Install-NodeLts.ps1 b/images/win/scripts/Installers/Install-NodeLts.ps1 index c1ee0579a..1b493ea87 100644 --- a/images/win/scripts/Installers/Install-NodeLts.ps1 +++ b/images/win/scripts/Installers/Install-NodeLts.ps1 @@ -33,3 +33,4 @@ npm install -g --save-dev webpack webpack-cli npm install -g yarn npm install -g lerna npm install -g node-sass +npm install -g newman diff --git a/images/win/scripts/Installers/Validate-NodeLts.ps1 b/images/win/scripts/Installers/Validate-NodeLts.ps1 index 201a86b35..7e621e393 100644 --- a/images/win/scripts/Installers/Validate-NodeLts.ps1 +++ b/images/win/scripts/Installers/Validate-NodeLts.ps1 @@ -35,3 +35,13 @@ else Write-Host "lerna is not on path" exit 1 } + +if (Get-Command -Name 'newman') +{ + Write-Host "Newman $(newman --version) is on the path." +} +else +{ + Write-Host "Newman is not on the path." + exit 1 +} diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index a87bde942..6e643fcf0 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -78,6 +78,7 @@ $markdown += New-MDList -Style Unordered -Lines @( (Get-MySQLVersion), (Get-MercurialVersion), (Get-NSISVersion), + (Get-NewmanVersion), (Get-OpenSSLVersion), (Get-PackerVersion), (Get-SQLPSVersion), diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 5093a8039..14c7da764 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -206,4 +206,8 @@ function Get-StackVersion { function Get-GoogleCloudSDKVersion { (gcloud --version) -match "Google Cloud SDK" +} + +function Get-NewmanVersion { + return "Newman $(newman --version)" } \ No newline at end of file