forked from rails/rails-dev-box
-
Notifications
You must be signed in to change notification settings - Fork 2
Updated for SQL Server #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8562f2b
Updated for SQL Server
aidanharan 0e26972
Small fixes
aidanharan 7c4e976
Updated gitignore
aidanharan 66a6282
Increased default ram to 4GB
aidanharan 5ef133b
Various changes
aidanharan d7a1c84
Use separate repository file for SQL Server
aidanharan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| .vagrant | ||
| *.log | ||
| rails | ||
| activerecord-sqlserver-adapter | ||
| .DS_Store |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,18 @@ | ||
| # -*- mode: ruby -*- | ||
| # vi: set ft=ruby : | ||
| Vagrant.configure('2') do |config| | ||
| config.vm.box = 'ubuntu/focal64' # 20.04 | ||
| config.vm.hostname = 'rails-dev-box' | ||
| config.vm.box = 'ubuntu/bionic64' # 18.04 | ||
wpolicarpo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| config.vm.hostname = 'activerecord-sqlserver-adapter-dev-box' | ||
|
|
||
| config.vm.network :forwarded_port, guest: 3000, host: 3000 | ||
| config.vm.network :forwarded_port, guest: 1433, host: 1433 | ||
|
|
||
| config.vm.provision :shell, path: 'bootstrap.sh', keep_color: true | ||
| config.vm.provision :shell, path: 'bootstrap_sqlserver.sh', keep_color: true | ||
|
|
||
| config.vm.provider 'virtualbox' do |v| | ||
| v.memory = ENV.fetch('RAILS_DEV_BOX_RAM', 2048).to_i | ||
| v.cpus = ENV.fetch('RAILS_DEV_BOX_CPUS', 2).to_i | ||
| v.name = 'activerecord-sql-server-dev-box' | ||
| v.memory = ENV.fetch('ACTIVERECORD_SQLSERVER_DEV_BOX_RAM', 4098).to_i | ||
wpolicarpo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| v.cpus = ENV.fetch('ACTIVERECORD_SQLSERVER_DEV_BOX_CPUS', 2).to_i | ||
| end | ||
| end | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/usr/bin/env bash | ||
| # The output of all these installation steps is noisy. With this utility | ||
| # the progress report is nice and concise. | ||
| function install { | ||
| echo installing $1 | ||
| shift | ||
| apt-get -y install "$@" >/dev/null 2>&1 | ||
| } | ||
|
|
||
| # TinyTDS | ||
| install libc6-dev libc6-dev | ||
| wget http://www.freetds.org/files/stable/freetds-1.1.32.tar.gz | ||
| tar -xzf freetds-1.1.32.tar.gz | ||
| cd freetds-1.1.32 | ||
| ./configure --prefix=/usr/local --with-tdsver=7.3 | ||
| make | ||
| make install | ||
|
|
||
| # Preparation | ||
| wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - | ||
| curl https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2017.list | sudo tee /etc/apt/sources.list.d/microsoft.mssql-server-2017.list | ||
| curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.prod.list | ||
| apt-get update | ||
|
|
||
| # Install SQL Server | ||
| install mssql-server mssql-server | ||
| MSSQL_PID=Developer ACCEPT_EULA=Yes MSSQL_SA_PASSWORD=MSSQLadmin! /opt/mssql/bin/mssql-conf --noprompt setup | ||
| systemctl status mssql-server --no-pager | ||
|
|
||
| # Install the SQL Server command-line tools | ||
| ACCEPT_EULA=Y apt-get install -y mssql-tools unixodbc-dev | ||
| echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> /home/vagrant/.bashrc | ||
|
|
||
| # Setup test databases and users | ||
| /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P MSSQLadmin! <<SQL | ||
| CREATE DATABASE [activerecord_unittest]; | ||
| CREATE DATABASE [activerecord_unittest2]; | ||
| GO | ||
| CREATE LOGIN [rails] WITH PASSWORD = '', CHECK_POLICY = OFF, DEFAULT_DATABASE = [activerecord_unittest]; | ||
| GO | ||
| USE [activerecord_unittest]; | ||
| CREATE USER [rails] FOR LOGIN [rails]; | ||
| GO | ||
| EXEC sp_addrolemember N'db_owner', N'rails'; | ||
| EXEC master..sp_addsrvrolemember @loginame = N'rails', @rolename = N'sysadmin'; | ||
| GO | ||
| SQL | ||
|
|
||
| # Misc | ||
| echo "test -d /vagrant/activerecord-sqlserver-adapter && cd /vagrant/activerecord-sqlserver-adapter" >> /home/vagrant/.bashrc | ||
|
|
||
| echo 'all set, rock on!' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.