mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-13 05:16:47 +00:00
Inital commit.
This commit is contained in:
43
images/linux/scripts/installers/mysql.sh
Normal file
43
images/linux/scripts/installers/mysql.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
################################################################################
|
||||
## File: mysql.sh
|
||||
## Desc: Installs MySQL Client
|
||||
################################################################################
|
||||
|
||||
## Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/document.sh
|
||||
|
||||
export ACCEPT_EULA=Y
|
||||
|
||||
# Install MySQL Client
|
||||
apt-get install mysql-client -y
|
||||
|
||||
# Install MySQL Server
|
||||
MYSQL_ROOT_PASSWORD=root
|
||||
echo "mysql-server mysql-server/root_password password $MYSQL_ROOT_PASSWORD" | debconf-set-selections
|
||||
echo "mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASSWORD" | debconf-set-selections
|
||||
|
||||
apt-get install -y mysql-server
|
||||
|
||||
# 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
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
if ! command -v mysql; then
|
||||
echo "mysql was not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -e
|
||||
mysql -vvv -e 'CREATE DATABASE smoke_test' -uroot -proot
|
||||
mysql -vvv -e 'DROP DATABASE smoke_test' -uroot -proot
|
||||
set +e
|
||||
|
||||
# Document what was added to the image
|
||||
echo "Lastly, documenting what we added to the metadata file"
|
||||
DocumentInstalledItem "MySQL ($(mysql --version))"
|
||||
DocumentInstalledItem "MySQL Server (user:root password:root)"
|
||||
DocumentInstalledItem "MS SQL Server Client Tools"
|
||||
Reference in New Issue
Block a user