From db91d1be917e490d3ccddc212a70c42e457a1c6f Mon Sep 17 00:00:00 2001 From: Marcus Felling Date: Wed, 16 Jun 2021 13:23:40 -0500 Subject: [PATCH 1/2] Add Bicep CLI --- images/win/scripts/Installers/Install-Bicep.ps1 | 8 ++++++++ .../scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 1 + .../win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 6 ++++++ images/win/scripts/Tests/Tools.Tests.ps1 | 6 ++++++ images/win/windows2016.json | 3 ++- images/win/windows2019.json | 3 ++- 6 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 images/win/scripts/Installers/Install-Bicep.ps1 diff --git a/images/win/scripts/Installers/Install-Bicep.ps1 b/images/win/scripts/Installers/Install-Bicep.ps1 new file mode 100644 index 000000000000..21a66ce23b58 --- /dev/null +++ b/images/win/scripts/Installers/Install-Bicep.ps1 @@ -0,0 +1,8 @@ +################################################################################ +## File: Install-Bicep.ps1 +## Desc: Install Bicep +################################################################################ + +Choco-Install -PackageName Bicep + +Invoke-PesterTests -TestFile "Tools" -TestName "Bicep" \ No newline at end of file diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 2c14ee9bc91f..a8e6d947288f 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -77,6 +77,7 @@ $markdown += New-MDList -Style Unordered -Lines (@( (Get-AzCopyVersion), (Get-BazelVersion), (Get-BazeliskVersion), + (Get-BicepVersion), (Get-CabalVersion), (Get-CMakeVersion), (Get-CodeQLBundleVersion), diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index eddd3de97374..546337963aca 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -18,6 +18,12 @@ function Get-BazeliskVersion { return "Bazelisk $bazeliskVersion" } +function Get-BicepVersion { + ($(bicep --version) | Out-String) -match "bicep version (?\d+\.\d+\.\d+)" | Out-Null + $bicepVersion = $Matches.Version + return "Bicep $bicepVersion" +} + function Get-RVersion { ($(cmd /c "Rscript --version 2>&1") | Out-String) -match "R scripting front-end version (?\d+\.\d+\.\d+)" | Out-Null $rVersion = $Matches.Version diff --git a/images/win/scripts/Tests/Tools.Tests.ps1 b/images/win/scripts/Tests/Tools.Tests.ps1 index db110f5f25d3..62f5846fa468 100644 --- a/images/win/scripts/Tests/Tools.Tests.ps1 +++ b/images/win/scripts/Tests/Tools.Tests.ps1 @@ -35,6 +35,12 @@ Describe "Bazel" { } } +Describe "Bicep" { + It "Bicep" { + "bicep --version" | Should -ReturnZeroExitCode + } +} + Describe "CMake" { It "cmake" { "cmake --version" | Should -ReturnZeroExitCode diff --git a/images/win/windows2016.json b/images/win/windows2016.json index 4c183f6ee86a..49d6baffe441 100644 --- a/images/win/windows2016.json +++ b/images/win/windows2016.json @@ -254,7 +254,8 @@ "{{ template_dir }}/scripts/Installers/Install-IEWebDriver.ps1", "{{ template_dir }}/scripts/Installers/Install-Apache.ps1", "{{ template_dir }}/scripts/Installers/Install-Nginx.ps1", - "{{ template_dir }}/scripts/Installers/Install-Swig.ps1" + "{{ template_dir }}/scripts/Installers/Install-Swig.ps1", + "{{ template_dir }}/scripts/Installers/Install-Bicep.ps1" ] }, { diff --git a/images/win/windows2019.json b/images/win/windows2019.json index 8bb66f535b33..00fee9966b89 100644 --- a/images/win/windows2019.json +++ b/images/win/windows2019.json @@ -258,7 +258,8 @@ "{{ template_dir }}/scripts/Installers/Install-IEWebDriver.ps1", "{{ template_dir }}/scripts/Installers/Install-Apache.ps1", "{{ template_dir }}/scripts/Installers/Install-Nginx.ps1", - "{{ template_dir }}/scripts/Installers/Install-Swig.ps1" + "{{ template_dir }}/scripts/Installers/Install-Swig.ps1", + "{{ template_dir }}/scripts/Installers/Install-Bicep.ps1" ] }, { From 7a1d5be807cc6ad81b733490da209cb79d9176ad Mon Sep 17 00:00:00 2001 From: Marcus Felling Date: Tue, 22 Jun 2021 09:17:36 -0500 Subject: [PATCH 2/2] Correct regex for bicep version --- images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 546337963aca..ad5eb2255ad4 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -19,7 +19,7 @@ function Get-BazeliskVersion { } function Get-BicepVersion { - ($(bicep --version) | Out-String) -match "bicep version (?\d+\.\d+\.\d+)" | Out-Null + (bicep --version | Out-String) -match "bicep cli version (?\d+\.\d+\.\d+)" | Out-Null $bicepVersion = $Matches.Version return "Bicep $bicepVersion" }