Last active
February 10, 2022 03:19
-
-
Save gavincampbell/a9b920ff7b1c7f3547aeeca46e186050 to your computer and use it in GitHub Desktop.
Vagrantfile for SQL Server on Linux with WideWorldImporters sample database and tSQLt framework included
This file contains hidden or 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
Vagrant.configure("2") do |config| | |
config.vm.box = "centos/7" | |
config.vm.network "forwarded_port", guest:1433, host:1433 | |
config.vm.provider :libvirt do |libvirt| | |
libvirt.memory = "4096" | |
end | |
config.vm.provision "shell", | |
inline: <<-SHELL | |
yum -y update | |
curl https://packages.microsoft.com/config/rhel/7/mssql-server.repo > /etc/yum.repos.d/mssql-server.repo | |
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/msprod.repo | |
curl https://github.com/Microsoft/sql-server-samples/releases/download/wide-world-importers-v1.0/WideWorldImporters-Full.bak > /vagrant/DbBackup/WideWorldImporters-Full.bak | |
yum install -y epel-release | |
yum install -y tcping | |
export ACCEPT_EULA=y | |
yum install -y mssql-server mssql-tools unixODBC-devel | |
export SA_PASSWORD='Vagrant2017' | |
/opt/mssql/bin/mssql-conf setup accept-eula | |
while ! tcping localhost 1433;do sleep 1; done | |
/opt/mssql-tools/bin/sqlcmd -Usa -PVagrant2017 -i /vagrant/Restore-DB.sql | |
/opt/mssql-tools/bin/sqlcmd -Usa -PVagrant2017 -dWideWorldImporters -i /vagrant/tSQLt/SetClrEnabled.sql | |
/opt/mssql-tools/bin/sqlcmd -Usa -PVagrant2017 -dWideWorldImporters -i /vagrant/tSQLt/tSQLt.class.sql | |
SHELL | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment