mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 05:07:02 +00:00
[Ubuntu] Add MS SQL Tools version (#2046)
* Add MS SQL Tools version * Minor fix * Move MS SQL tools installation to separated file * Minor fix * accept yula
This commit is contained in:
committed by
GitHub
parent
efcf173e49
commit
a454d66e7f
@@ -18,18 +18,33 @@ function Get-MySQLVersion {
|
|||||||
return "MySQL $mySQLVersion"
|
return "MySQL $mySQLVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-SQLCmdVersion {
|
||||||
|
$sqlcmdVersion = sqlcmd -? | Select-String -Pattern "Version" | Take-OutputPart -Part 1
|
||||||
|
return "sqlcmd $sqlcmdVersion"
|
||||||
|
}
|
||||||
|
|
||||||
function Build-MySQLSection {
|
function Build-MySQLSection {
|
||||||
$output = ""
|
$output = ""
|
||||||
|
|
||||||
$output += New-MDHeader "MySQL" -Level 4
|
$output += New-MDHeader "MySQL" -Level 4
|
||||||
$output += New-MDList -Style Unordered -Lines @(
|
$output += New-MDList -Style Unordered -Lines @(
|
||||||
(Get-MySQLVersion ),
|
(Get-MySQLVersion ),
|
||||||
"MySQL Server (user:root password:root)",
|
"MySQL Server (user:root password:root)"
|
||||||
"MS SQL Server Client Tools"
|
|
||||||
)
|
)
|
||||||
$output += New-MDCode -Lines @(
|
$output += New-MDCode -Lines @(
|
||||||
"MySQL service is disabled by default. Use the following command as a part of your job to start the service: 'sudo systemctl start mysql.service'"
|
"MySQL service is disabled by default. Use the following command as a part of your job to start the service: 'sudo systemctl start mysql.service'"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
return $output
|
||||||
|
}
|
||||||
|
|
||||||
|
function Build-MSSQLToolsSection {
|
||||||
|
$output = ""
|
||||||
|
|
||||||
|
$output += New-MDHeader "MS SQL Server Client Tools" -Level 4
|
||||||
|
$output += New-MDList -Style Unordered -Lines @(
|
||||||
|
(Get-SQLCmdVersion)
|
||||||
|
)
|
||||||
|
|
||||||
return $output
|
return $output
|
||||||
}
|
}
|
||||||
@@ -215,6 +215,7 @@ $markdown += New-MDList -Style Unordered -Lines @(
|
|||||||
)
|
)
|
||||||
|
|
||||||
$markdown += Build-MySQLSection
|
$markdown += Build-MySQLSection
|
||||||
|
$markdown += Build-MSSQLToolsSection
|
||||||
|
|
||||||
$markdown += New-MDHeader "Cached Tools" -Level 3
|
$markdown += New-MDHeader "Cached Tools" -Level 3
|
||||||
$markdown += Build-CachedToolsSection
|
$markdown += Build-CachedToolsSection
|
||||||
|
|||||||
18
images/linux/scripts/installers/mssql-cmd-tools.sh
Normal file
18
images/linux/scripts/installers/mssql-cmd-tools.sh
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
################################################################################
|
||||||
|
## File: mssql-cmd-tools.sh
|
||||||
|
## Desc: Install MS SQL Server client tools (https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools?view=sql-server-2017)
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
export ACCEPT_EULA=Y
|
||||||
|
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y mssql-tools unixodbc-dev
|
||||||
|
apt-get -f install
|
||||||
|
ln -s /opt/mssql-tools/bin/* /usr/local/bin/
|
||||||
|
|
||||||
|
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||||
|
if ! command -v sqlcmd; then
|
||||||
|
echo "sqlcmd was not installed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -31,11 +31,6 @@ apt-get install -y mysql-server
|
|||||||
#Install MySQL Dev tools
|
#Install MySQL Dev tools
|
||||||
apt install libmysqlclient-dev -y
|
apt install libmysqlclient-dev -y
|
||||||
|
|
||||||
# Install MS SQL Server client tools (https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools?view=sql-server-2017)
|
|
||||||
apt-get install -y mssql-tools unixodbc-dev
|
|
||||||
apt-get -f install
|
|
||||||
ln -s /opt/mssql-tools/bin/* /usr/local/bin/
|
|
||||||
|
|
||||||
# Run tests to determine that the software installed as expected
|
# Run tests to determine that the software installed as expected
|
||||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||||
if ! command -v mysql; then
|
if ! command -v mysql; then
|
||||||
|
|||||||
@@ -190,6 +190,7 @@
|
|||||||
"{{template_dir}}/scripts/installers/miniconda.sh",
|
"{{template_dir}}/scripts/installers/miniconda.sh",
|
||||||
"{{template_dir}}/scripts/installers/mono.sh",
|
"{{template_dir}}/scripts/installers/mono.sh",
|
||||||
"{{template_dir}}/scripts/installers/mysql.sh",
|
"{{template_dir}}/scripts/installers/mysql.sh",
|
||||||
|
"{{template_dir}}/scripts/installers/mssql-cmd-tools.sh",
|
||||||
"{{template_dir}}/scripts/installers/nodejs.sh",
|
"{{template_dir}}/scripts/installers/nodejs.sh",
|
||||||
"{{template_dir}}/scripts/installers/bazel.sh",
|
"{{template_dir}}/scripts/installers/bazel.sh",
|
||||||
"{{template_dir}}/scripts/installers/oras-cli.sh",
|
"{{template_dir}}/scripts/installers/oras-cli.sh",
|
||||||
|
|||||||
@@ -193,6 +193,7 @@
|
|||||||
"{{template_dir}}/scripts/installers/miniconda.sh",
|
"{{template_dir}}/scripts/installers/miniconda.sh",
|
||||||
"{{template_dir}}/scripts/installers/mono.sh",
|
"{{template_dir}}/scripts/installers/mono.sh",
|
||||||
"{{template_dir}}/scripts/installers/mysql.sh",
|
"{{template_dir}}/scripts/installers/mysql.sh",
|
||||||
|
"{{template_dir}}/scripts/installers/mssql-cmd-tools.sh",
|
||||||
"{{template_dir}}/scripts/installers/nvm.sh",
|
"{{template_dir}}/scripts/installers/nvm.sh",
|
||||||
"{{template_dir}}/scripts/installers/nodejs.sh",
|
"{{template_dir}}/scripts/installers/nodejs.sh",
|
||||||
"{{template_dir}}/scripts/installers/bazel.sh",
|
"{{template_dir}}/scripts/installers/bazel.sh",
|
||||||
|
|||||||
@@ -203,6 +203,7 @@
|
|||||||
"{{template_dir}}/scripts/installers/miniconda.sh",
|
"{{template_dir}}/scripts/installers/miniconda.sh",
|
||||||
"{{template_dir}}/scripts/installers/mono.sh",
|
"{{template_dir}}/scripts/installers/mono.sh",
|
||||||
"{{template_dir}}/scripts/installers/mysql.sh",
|
"{{template_dir}}/scripts/installers/mysql.sh",
|
||||||
|
"{{template_dir}}/scripts/installers/mssql-cmd-tools.sh",
|
||||||
"{{template_dir}}/scripts/installers/nvm.sh",
|
"{{template_dir}}/scripts/installers/nvm.sh",
|
||||||
"{{template_dir}}/scripts/installers/nodejs.sh",
|
"{{template_dir}}/scripts/installers/nodejs.sh",
|
||||||
"{{template_dir}}/scripts/installers/bazel.sh",
|
"{{template_dir}}/scripts/installers/bazel.sh",
|
||||||
|
|||||||
Reference in New Issue
Block a user