-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
OSOE-481: Action pulls latest SQL Server (=2022-latest) but 2019-latest is used in Lombiq.GitHub.Actions
- Loading branch information
Showing
3 changed files
with
15 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
param ( | ||
[string]$sqlServerVersion = '2022' | ||
) | ||
|
||
if ($Env:RUNNER_OS -eq 'Windows') | ||
{ | ||
choco install sql-server-express --no-progress | ||
choco install sql-server-$sqlServerVersion --no-progress | ||
} | ||
else | ||
{ | ||
$containerName = 'uitt-sqlserver' | ||
$sqlServerLink = "mcr.microsoft.com/mssql/server:${sqlServerVersion}-latest" | ||
|
||
$dockerRunSwitches = @( | ||
'--name', 'sql2019' | ||
'--name', $containerName | ||
'--env', 'ACCEPT_EULA=Y' | ||
'--env', 'SA_PASSWORD=Password1!' | ||
'--publish', '1433:1433' | ||
'--detach', 'mcr.microsoft.com/mssql/server:2019-latest' | ||
'--detach', $sqlServerLink | ||
) | ||
|
||
docker pull mcr.microsoft.com/mssql/server && | ||
docker pull $sqlServerLink && | ||
docker run @dockerRunSwitches && | ||
docker exec --user 0 sql2019 bash -c 'mkdir /data; chmod 777 /data --recursive; chown mssql:root /data' | ||
docker exec --user 0 $containerName bash -c 'mkdir /data; chmod 777 /data --recursive; chown mssql:root /data' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters