From e8381d7db3a011a744a9d76eebb6e044327cfdae Mon Sep 17 00:00:00 2001 From: Marcus Felling Date: Wed, 7 Jul 2021 09:10:31 -0500 Subject: [PATCH] [macOS] Adding Bicep CLI (#3655) * Add Bicep CLI * Correct regex for bicep version * Add Bicep CLI * use tap path for bicep brew install * use tap path for bicep brew install * use tap path for bicep brew install * Update bicep package name * Update bicep package name * Update bicep package name * Add install script in order to run homebrew tap * no need to reference utils.sh * Remove bicep from common packages * Add "CLI" to Bicep return statement Co-authored-by: Marcus Felling --- images/macos/provision/core/bicep.sh | 7 +++++++ images/macos/software-report/SoftwareReport.Common.psm1 | 5 +++++ images/macos/software-report/SoftwareReport.Generator.ps1 | 3 ++- images/macos/templates/macOS-10.14.json | 3 ++- images/macos/templates/macOS-10.15.json | 3 ++- images/macos/templates/macOS-11.json | 3 ++- images/macos/tests/Common.Tests.ps1 | 6 ++++++ 7 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 images/macos/provision/core/bicep.sh diff --git a/images/macos/provision/core/bicep.sh b/images/macos/provision/core/bicep.sh new file mode 100644 index 000000000..a2e7b5849 --- /dev/null +++ b/images/macos/provision/core/bicep.sh @@ -0,0 +1,7 @@ +#!/bin/bash -e -o pipefail + +echo Installing bicep cli... +brew tap azure/bicep +brew install bicep + +invoke_tests "Common" "Bicep" diff --git a/images/macos/software-report/SoftwareReport.Common.psm1 b/images/macos/software-report/SoftwareReport.Common.psm1 index f94ef3865..e85a47ec5 100644 --- a/images/macos/software-report/SoftwareReport.Common.psm1 +++ b/images/macos/software-report/SoftwareReport.Common.psm1 @@ -502,6 +502,11 @@ function Get-SwigVersion { return "Swig $swigVersion" } +function Get-BicepVersion { + $bicepVersion = Run-Command "bicep --version" | Take-Part -Part 3 + return "Bicep CLI $bicepVersion" +} + function Build-PackageManagementEnvironmentTable { return @( @{ diff --git a/images/macos/software-report/SoftwareReport.Generator.ps1 b/images/macos/software-report/SoftwareReport.Generator.ps1 index b2eca6c39..13252fb3d 100644 --- a/images/macos/software-report/SoftwareReport.Generator.ps1 +++ b/images/macos/software-report/SoftwareReport.Generator.ps1 @@ -167,7 +167,8 @@ $toolsList = @( (Get-AWSSessionManagerCLIVersion), (Get-AliyunCLIVersion), (Get-XcodeCommandLineToolsVersion), - (Get-SwigVersion) + (Get-SwigVersion), + (Get-BicepVersion) ) if( -not $os.IsHighSierra) { diff --git a/images/macos/templates/macOS-10.14.json b/images/macos/templates/macOS-10.14.json index 35c04d76d..a0fd28278 100644 --- a/images/macos/templates/macOS-10.14.json +++ b/images/macos/templates/macOS-10.14.json @@ -183,7 +183,8 @@ "./provision/core/xcode-sims.sh", "./provision/core/xcode-postbuild.sh", "./provision/core/pypy.sh", - "./provision/core/pipx-packages.sh" + "./provision/core/pipx-packages.sh", + "./provision/core/bicep.sh" ] }, { diff --git a/images/macos/templates/macOS-10.15.json b/images/macos/templates/macOS-10.15.json index 92b2f36c6..eeb578d1e 100644 --- a/images/macos/templates/macOS-10.15.json +++ b/images/macos/templates/macOS-10.15.json @@ -186,7 +186,8 @@ "./provision/core/firefox.sh", "./provision/core/xcode-postbuild.sh", "./provision/core/pypy.sh", - "./provision/core/pipx-packages.sh" + "./provision/core/pipx-packages.sh", + "./provision/core/bicep.sh" ] }, { diff --git a/images/macos/templates/macOS-11.json b/images/macos/templates/macOS-11.json index f8661baa1..cf8bcbc98 100644 --- a/images/macos/templates/macOS-11.json +++ b/images/macos/templates/macOS-11.json @@ -189,7 +189,8 @@ "./provision/core/edge.sh", "./provision/core/firefox.sh", "./provision/core/pypy.sh", - "./provision/core/pipx-packages.sh" + "./provision/core/pipx-packages.sh", + "./provision/core/bicep.sh" ] }, { diff --git a/images/macos/tests/Common.Tests.ps1 b/images/macos/tests/Common.Tests.ps1 index 79f47bb36..0c2366a1b 100644 --- a/images/macos/tests/Common.Tests.ps1 +++ b/images/macos/tests/Common.Tests.ps1 @@ -92,3 +92,9 @@ Describe "Swig" { "swig -version" | Should -ReturnZeroExitCode } } + +Describe "Bicep" { + It "Bicep" { + "bicep --version" | Should -ReturnZeroExitCode + } +} \ No newline at end of file