diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Databases.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Databases.psm1 index e80c1b2d9..8bcb840e0 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Databases.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Databases.psm1 @@ -25,6 +25,11 @@ function Get-SQLCmdVersion { return "sqlcmd $sqlcmdVersion" } +function Get-SqlPackageVersion { + $sqlPackageVersion = sqlpackage /version + return "SqlPackage $sqlPackageVersion" +} + function Build-MySQLSection { $output = "" @@ -45,7 +50,8 @@ function Build-MSSQLToolsSection { $output += New-MDHeader "MS SQL Server Client Tools" -Level 4 $output += New-MDList -Style Unordered -Lines @( - (Get-SQLCmdVersion) + (Get-SQLCmdVersion), + (Get-SqlPackageVersion) ) return $output diff --git a/images/linux/scripts/installers/sqlpackage.sh b/images/linux/scripts/installers/sqlpackage.sh new file mode 100644 index 000000000..86a1a4995 --- /dev/null +++ b/images/linux/scripts/installers/sqlpackage.sh @@ -0,0 +1,18 @@ +#!/bin/bash -e +################################################################################ +## File: sqlpackage.sh +## Desc: Install SqlPackage CLI to DacFx (https://docs.microsoft.com/sql/tools/sqlpackage/sqlpackage-download#get-sqlpackage-net-core-for-linux) +################################################################################ + +# Source the helpers for use with the script +source $HELPER_SCRIPTS/install.sh + +# Install SqlPackage +download_with_retries "https://aka.ms/sqlpackage-linux" "." "sqlpackage.zip" + +unzip -qq sqlpackage.zip -d /usr/local/sqlpackage +rm -f sqlpackage.zip +chmod +x /usr/local/sqlpackage/sqlpackage +ln -sf /usr/local/sqlpackage/sqlpackage /usr/local/bin + +invoke_tests "Tools" "SqlPackage" diff --git a/images/linux/scripts/tests/Tools.Tests.ps1 b/images/linux/scripts/tests/Tools.Tests.ps1 index dd92811fb..1caa559e4 100644 --- a/images/linux/scripts/tests/Tools.Tests.ps1 +++ b/images/linux/scripts/tests/Tools.Tests.ps1 @@ -171,6 +171,12 @@ Describe "MSSQLCommandLineTools" { } } +Describe "SqlPackage" { + It "sqlpackage" { + "sqlpackage /version" | Should -ReturnZeroExitCode + } +} + Describe "R" { It "r" { "R --version" | Should -ReturnZeroExitCode diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 03fb8d806..8c300c593 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -226,6 +226,7 @@ "{{template_dir}}/scripts/installers/mono.sh", "{{template_dir}}/scripts/installers/mysql.sh", "{{template_dir}}/scripts/installers/mssql-cmd-tools.sh", + "{{template_dir}}/scripts/installers/sqlpackage.sh", "{{template_dir}}/scripts/installers/nginx.sh", "{{template_dir}}/scripts/installers/nvm.sh", "{{template_dir}}/scripts/installers/nodejs.sh", diff --git a/images/linux/ubuntu2004.json b/images/linux/ubuntu2004.json index c6d10ae44..6d333e3c0 100644 --- a/images/linux/ubuntu2004.json +++ b/images/linux/ubuntu2004.json @@ -226,6 +226,7 @@ "{{template_dir}}/scripts/installers/mono.sh", "{{template_dir}}/scripts/installers/mysql.sh", "{{template_dir}}/scripts/installers/mssql-cmd-tools.sh", + "{{template_dir}}/scripts/installers/sqlpackage.sh", "{{template_dir}}/scripts/installers/nginx.sh", "{{template_dir}}/scripts/installers/nvm.sh", "{{template_dir}}/scripts/installers/nodejs.sh",