Provision MS SQL Server on Linux dev VM#577
Conversation
|
Note that because of the existing issues in |
| @@ -0,0 +1,231 @@ | |||
| USE FitNesseTestDB | |||
There was a problem hiding this comment.
This file seems to have window-style end of lines. Now that we're on Linux - would it be possible to convert it to Unix style (dos2unix)?
| GO | ||
|
|
||
| CREATE USER [FitNesseUser] FOR LOGIN [FitNesseUser] WITH DEFAULT_SCHEMA = [dbo] | ||
| GO |
There was a problem hiding this comment.
There is a trailing whitespace at this line.
There was a problem hiding this comment.
Fixed this one too.
| @@ -0,0 +1,26 @@ | |||
| ALTER DATABASE DbFit SET SINGLE_USER WITH ROLLBACK IMMEDIATE | |||
There was a problem hiding this comment.
Windows style EOL here too.
| ext.dbdeploy = { dbDriver, url, userid, password, delimiterType = 'normal' -> | ||
| ext.dbdeploy = { | ||
| dbDriver, url, userid, password, delimiterType = 'normal', delimiter = ';', | ||
| dir = "$projectDir/src/integration-test/resources" -> |
There was a problem hiding this comment.
Will dbdeploy pick only script filenames starting with some digits (as we already have some .sql scripts under resources).
There was a problem hiding this comment.
I meant to delete those other scripts. Yes, dbdeploy only picks up scripts that start with a number.
45e6631 to
ddc4020
Compare
|
Perhaps it's good to update CONTRIBUTING.md. |
| sql_dir = File.join(node['dbfit']['project_root'], "test_vm/scripts/sqlserver/sql") | ||
|
|
||
| execute 'create databases' do | ||
| command "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P DbFit000! -b -i #{sql_dir}/create-databases-sqlserver.sql" |
There was a problem hiding this comment.
Is it OK that we don't have some kind of not_if expression here? What would happen if we re-run VM provisioning?
There was a problem hiding this comment.
Is it OK that we don't have some kind of not_if expression here? What would happen if we re-run VM provisioning?
I'd have to check the SQL Server DBs to see if this had already been run, using a SQL script and perhaps a shell script wrapper.
Alternatively I can add IF NOT EXISTS (SELECT 1 FROM master.sys.databases WHERE name = ...) CREATE DATABASE....
It would be more complex for the users and role grants, etc.
The other option would be for provisioning to destroy anything if finds already existing and recreate them. That's not so good.
There was a problem hiding this comment.
The other option would be for provisioning to destroy anything if finds already existing and recreate them. That's not so good.
What about checking just for single thing - e.g. the changelog table. If it exists - then skip attempt for re-provisioning.
There was a problem hiding this comment.
I've added a check for the changelog table now. Please review again.
ddc4020 to
f18da75
Compare
|
|
||
| package 'mssql-server' | ||
|
|
||
| ENV['SA_PASSWORD'] = 'DbFit000!' |
There was a problem hiding this comment.
We're using the same password in multiple places, can we reuse it at least within the same script?
There was a problem hiding this comment.
We're using the same password in multiple places, can we reuse it at least within the same script?
Updated.
Done. |
1644e99 to
5b4a554
Compare
5b4a554 to
de8b49c
Compare
|
Rebased and force pushed. |
|
Awesome :-) It looks great now 👍, I'm merging it. Thank you @MMatten - it's really useful to finally have that "outsider" in the VM! |
Pulls SQL Server from MS package repository, installs, configures and creates acceptance testing objects during gradle
integrationTestandintegrationBuildtasks.