File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 2525 version :
2626 - 2017
2727 - 2019
28+ - 2022
2829 exclude :
2930 - force-encryption : " true"
3031 os : ubuntu-24.04
Original file line number Diff line number Diff line change @@ -13,10 +13,12 @@ inputs:
1313 default : " false"
1414 sa-password :
1515 description : " The SA password for the SQL instance"
16- required : true
16+ required : false
17+ default : " bHuZH81%cGC6"
1718 version :
1819 description : " The version of the SQL instance"
19- required : true
20+ required : false
21+ default : " 2022"
2022runs :
2123 using : " composite"
2224 steps :
Original file line number Diff line number Diff line change 33 [string []]$Components ,
44 [bool ]$ForceEncryption ,
55 [string ]$SaPassword ,
6- [ValidateSet (" 2017" , " 2019" )]
6+ [ValidateSet (" 2017" , " 2019" , " 2022 " )]
77 [string ]$Version
88)
99
@@ -101,8 +101,15 @@ forceencryption = 1
101101 $AdditionalContainerConfiguration = " -v /opt/mssql/mssql.conf:/var/opt/mssql/mssql.conf -v /opt/mssql/mssql.pem:/var/opt/mssql/mssql.pem -v /opt/mssql/mssql.key:/var/opt/mssql/mssql.key"
102102 }
103103
104+ if ($Version -Eq " 2022" ) {
105+ $ToolsPath = " /opt/mssql-tools18"
106+ }
107+ else {
108+ $ToolsPath = " /opt/mssql-tools"
109+ }
110+
104111 Write-Output " Starting a Docker Container"
105- Invoke-Expression " docker run --name=`" sql`" -e `" ACCEPT_EULA=Y`" -e `" SA_PASSWORD=$SaPassword `" -e `" MSSQL_PID=Express`" --health-cmd=`" /opt/mssql-tools /bin/sqlcmd -C -S localhost -U sa -P '$SaPassword ' -Q 'SELECT 1' -b -o /dev/null`" --health-start-period=`" 10s`" --health-retries=3 --health-interval=`" 10s`" -p 1433:1433 $AdditionalContainerConfiguration -d `" mcr.microsoft.com/mssql/server:$Version -latest`" "
112+ Invoke-Expression " docker run --name=`" sql`" -e `" ACCEPT_EULA=Y`" -e `" SA_PASSWORD=$SaPassword `" -e `" MSSQL_PID=Express`" --health-cmd=`" $ToolsPath /bin/sqlcmd -C -S localhost -U sa -P '$SaPassword ' -Q 'SELECT 1' -b -o /dev/null`" --health-start-period=`" 10s`" --health-retries=3 --health-interval=`" 10s`" -p 1433:1433 $AdditionalContainerConfiguration -d `" mcr.microsoft.com/mssql/server:$Version -latest`" "
106113 Wait-ForContainer
107114 }
108115
@@ -119,6 +126,10 @@ forceencryption = 1
119126 $DownloadUrl = " https://download.microsoft.com/download/7/c/1/7c14e92e-bdcb-4f89-b7cf-93543e7112d1/SQLEXPR_x64_ENU.exe"
120127 $MajorVersion = 15
121128 }
129+ " 2022" {
130+ $DownloadUrl = " https://download.microsoft.com/download/3/8/d/38de7036-2433-4207-8eae-06e247e17b25/SQLEXPR_x64_ENU.exe"
131+ $MajorVersion = 16
132+ }
122133 }
123134
124135 Invoke-WebRequest $DownloadUrl - OutFile " C:\Downloads\mssql.exe"
You can’t perform that action at this time.
0 commit comments