Skip to content

Commit

Permalink
added appveyor.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-page committed Aug 8, 2016
1 parent 4f76c35 commit 25cd61e
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 116 deletions.
28 changes: 28 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "{build}"

services: mssql2014

environment:
matrix:
- nodejs_version: "0.10"
- nodejs_version: "0.12"
- nodejs_version: "4"
- nodejs_version: "5"
- nodejs_version: "6"

branches:
only:
- master

install:
- ps: Install-Product node $env:nodejs_version
- cmd: npm install

cache: node_modules
build: off

before_test:
- ps: Start-Process enable-sql-server-tcp-ip.ps1

test_script:
- cmd: npm test
25 changes: 25 additions & 0 deletions enable-sql-server-tcp-ip.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null

$instanceName = 'sql2014'
$computerName = $env:COMPUTERNAME
$smo = 'Microsoft.SqlServer.Management.Smo.'
$wmi = New-Object ($smo + 'Wmi.ManagedComputer')

# For the named instance, on the current computer, for the TCP protocol,
# loop through all the IPs and configure them to use the standard port
# of 1433.
$uri = "ManagedComputer[@Name='$computerName']/ ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Tcp']"
$Tcp = $wmi.GetSmoObject($uri)
ForEach ($ipAddress in $Tcp.IPAddresses)
{
$ipAddress.IPAddressProperties["TcpDynamicPorts"].Value = ""
$ipAddress.IPAddressProperties["TcpPort"].Value = "1433"
}
$Tcp.IsEnabled = $true
$Tcp.Alter()

# Start services
Set-Service SQLBrowser -StartupType Manual
Start-Service SQLBrowser
Restart-Service "MSSQL`$$instanceName"
Loading

0 comments on commit 25cd61e

Please sign in to comment.