3
3
# ---------------------------------#
4
4
5
5
# Build worker image (VM template)
6
- image : Visual Studio 2017
6
+ image :
7
+ - Visual Studio 2017
8
+ - Ubuntu
7
9
8
10
# scripts that run after cloning repository
9
11
install :
10
12
# install SQL Server 2008 R2 SP2 Express (not included in VS 2017 image; see: https://www.appveyor.com/docs/build-environment/#databases)
11
- - curl -L -O -S -s https://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPR_x64_ENU.exe
12
- - SQLEXPR_x64_ENU.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=SQL2008R2SP2 /TCPENABLED=1 /SECURITYMODE=SQL /SAPWD=Password12! /ADDCURRENTUSERASSQLADMIN /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /AGTSVCACCOUNT="NT AUTHORITY\Network Service"
13
+ - cmd : curl -L -O -S -s https://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPR_x64_ENU.exe
14
+ - cmd : SQLEXPR_x64_ENU.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=SQL2008R2SP2 /TCPENABLED=1 /SECURITYMODE=SQL /SAPWD=Password12! /ADDCURRENTUSERASSQLADMIN /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /AGTSVCACCOUNT="NT AUTHORITY\Network Service"
13
15
14
16
# install SQL Server 2012 SP1 Express (not included in VS 2017 image; see: https://www.appveyor.com/docs/build-environment/#databases)
15
- - curl -L -O -S -s https://download.microsoft.com/download/5/2/9/529FEF7B-2EFB-439E-A2D1-A1533227CD69/SQLEXPR_x64_ENU.exe
16
- - SQLEXPR_x64_ENU.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=SQL2012SP1 /TCPENABLED=1 /SECURITYMODE=SQL /SAPWD=Password12! /ADDCURRENTUSERASSQLADMIN /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /AGTSVCACCOUNT="NT AUTHORITY\Network Service"
17
+ - cmd : curl -L -O -S -s https://download.microsoft.com/download/5/2/9/529FEF7B-2EFB-439E-A2D1-A1533227CD69/SQLEXPR_x64_ENU.exe
18
+ - cmd : SQLEXPR_x64_ENU.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=SQL2012SP1 /TCPENABLED=1 /SECURITYMODE=SQL /SAPWD=Password12! /ADDCURRENTUSERASSQLADMIN /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /AGTSVCACCOUNT="NT AUTHORITY\Network Service"
17
19
18
20
# install x86 CLR types for SQL Server 2012 SP1 (required when running dotnet test for MsSql tests)
19
- - curl -L -O -S -s https://download.microsoft.com/download/4/B/1/4B1E9B0E-A4F3-4715-B417-31C82302A70A/ENU/x86/SQLSysClrTypes.msi
20
- - SQLSysClrTypes.msi /passive
21
+ - cmd : curl -L -O -S -s https://download.microsoft.com/download/4/B/1/4B1E9B0E-A4F3-4715-B417-31C82302A70A/ENU/x86/SQLSysClrTypes.msi
22
+ - cmd : SQLSysClrTypes.msi /passive
21
23
22
24
# enable dynamic TCP ports for 2008 and 2012 SQL Server instances (so they can be run simultaneously)
23
- - ps : set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
24
- - ps : set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
25
- - ps : set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0'
26
- - ps : set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value ''
25
+ - ps : if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0' }
26
+ - ps : if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql10_50.SQL2008R2SP2\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value '' }
27
+ - ps : if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpDynamicPorts -value '0' }
28
+ - ps : if ($isWindows) { set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql11.SQL2012SP1\mssqlserver\supersocketnetlib\tcp\ipall' -name TcpPort -value '' }
27
29
28
30
# install MySQL 5.6
29
- # - curl -L -O -S -s https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-web-community-5.6.36.0.msi
30
- # - msiexec /i mysql-installer-web-community-5.6.36.0.msi /quiet
31
- # - cmd /c "" C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe" community install server;5.6.36;x64:*:port=3306;passwd=Password12! -silent"
31
+ # - cmd: curl -L -O -S -s https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-web-community-5.6.36.0.msi
32
+ # - cmd: msiexec /i mysql-installer-web-community-5.6.36.0.msi /quiet
33
+ # - cmd: " C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe" community install server;5.6.36;x64:*:port=3306;passwd=Password12! -silent
32
34
33
35
# change default port for MySQL 5.7 (so it can run simultaneously with MySQL 5.6)
34
- # - ps: $ iniPath = 'C:\ProgramData\MySQL\MySQL Server 5.7\my.ini'
35
- # - ps: ( Get-Content $iniPath).replace('port=3306', 'port=3307') | Set-Content $iniPath
36
+ # - ps: if ($isWindows) { $ iniPath = 'C:\ProgramData\MySQL\MySQL Server 5.7\my.ini' }
37
+ # - ps: if ($isWindows) { ( Get-Content $iniPath).replace('port=3306', 'port=3307') | Set-Content $iniPath }
36
38
37
39
# install PostgreSQL 8.4
38
- - curl -L -O -S -s https://get.enterprisedb.com/postgresql/postgresql-8.4.22-1-windows.exe
39
- - postgresql-8.4.22-1-windows.exe --mode unattended --superpassword Password12! --serverport 5431
40
+ - cmd : curl -L -O -S -s https://get.enterprisedb.com/postgresql/postgresql-8.4.22-1-windows.exe
41
+ - cmd : postgresql-8.4.22-1-windows.exe --mode unattended --superpassword Password12! --serverport 5431
40
42
41
43
# install PostGIS 1.5.5 for PostgreSQL 8.4
42
- - curl -L -O -S -s http://download.osgeo.org/postgis/windows/pg84/postgis-pg84-binaries-1.5.5.zip
43
- - 7z x postgis-pg84-binaries-1.5.5.zip > nul
44
- - xcopy /s /y /q postgis-pg84-binaries-1.5.5 "C:\Program Files (x86)\PostgreSQL\8.4"
45
- - SET PGPASSWORD=Password12!
46
- - SET PGDIR=C:\Program Files (x86)\PostgreSQL\8.4
47
- - cmd /c ""%PGDIR%\bin\createdb" -p 5431 -U postgres template_postgis"
48
- - cmd /c ""%PGDIR%\bin\psql" -q -p 5431 -U postgres -d template_postgis -f "%PGDIR%\share\contrib\postgis-1.5\postgis.sql""
49
- - cmd /c ""%PGDIR%\bin\psql" -q -p 5431 -U postgres -d template_postgis -f "%PGDIR%\share\contrib\postgis-1.5\spatial_ref_sys.sql""
44
+ - cmd : curl -L -O -S -s http://download.osgeo.org/postgis/windows/pg84/postgis-pg84-binaries-1.5.5.zip
45
+ - cmd : 7z x postgis-pg84-binaries-1.5.5.zip > nul
46
+ - cmd : xcopy /s /y /q postgis-pg84-binaries-1.5.5 "C:\Program Files (x86)\PostgreSQL\8.4"
47
+ - cmd : SET PGPASSWORD=Password12!
48
+ - cmd : SET PGDIR=C:\Program Files (x86)\PostgreSQL\8.4
49
+ - cmd : SET PATH=%PGDIR%\bin;%PATH%
50
+ - cmd : createdb -p 5431 -U postgres template_postgis
51
+ - cmd : psql -q -p 5431 -U postgres -d template_postgis -f "%PGDIR%\share\contrib\postgis-1.5\postgis.sql"
52
+ - cmd : psql -q -p 5431 -U postgres -d template_postgis -f "%PGDIR%\share\contrib\postgis-1.5\spatial_ref_sys.sql"
50
53
51
- # install PostGIS 2.3.2 for PostgreSQL 9.6
52
- - curl -L -O -S -s http://download.osgeo.org/postgis/windows/pg96/archive/postgis-bundle-pg96-2.3.2x64.zip
53
- - 7z x postgis-bundle-pg96-2.3.2x64.zip > nul
54
- - xcopy /s /y /q postgis-bundle-pg96-2.3.2x64 "C:\Program Files\PostgreSQL\9.6"
54
+ # install PostGIS 2.3.2 for PostgreSQL 9.6 on Windows
55
+ - cmd : curl -L -O -S -s http://download.osgeo.org/postgis/windows/pg96/archive/postgis-bundle-pg96-2.3.2x64.zip
56
+ - cmd : 7z x postgis-bundle-pg96-2.3.2x64.zip > nul
57
+ - cmd : xcopy /s /y /q postgis-bundle-pg96-2.3.2x64 "C:\Program Files\PostgreSQL\9.6"
55
58
56
- # start services required for build/tests
57
- services :
58
- # - mysql56 # start MySQL 5.6
59
- # - mysql57 # start MySQL 5.7
60
- - postgresql96 # start PostgreSQL 9.6
59
+ # install PostgreSQL 9.6 and PostGIS 2.3 on Ubuntu
60
+ - sh : sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main"
61
+ - sh : wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
62
+ - sh : sudo apt-get update
63
+ - sh : sudo apt-get -y install postgresql-9.6 postgresql-9.6-postgis-2.3
64
+ - sh : sudo sed -i 's/port = [0-9]\+/port = 5432/' /etc/postgresql/9.6/main/postgresql.conf
61
65
62
66
# ---------------------------------#
63
67
# build configuration #
74
78
75
79
# scripts to run before build
76
80
before_build :
77
- - cmd : dotnet --version
78
- - cmd : dotnet restore --verbosity minimal
81
+ - dotnet --version
82
+ - dotnet restore --verbosity minimal
79
83
80
84
# ---------------------------------#
81
85
# tests configuration #
@@ -84,27 +88,35 @@ before_build:
84
88
# scripts to run before tests
85
89
before_test :
86
90
# setup SQL Server 2008
87
- - sqlcmd -S (local)\SQL2008R2SP2 -i Tests.NHibernate.Spatial.MsSql2008\nhsp_test.sql
91
+ - cmd : sqlcmd -S (local)\SQL2008R2SP2 -i Tests.NHibernate.Spatial.MsSql2008\nhsp_test.sql
88
92
89
93
# setup SQL Server 2012
90
- - sqlcmd -S (local)\SQL2012SP1 -i Tests.NHibernate.Spatial.MsSql2012\nhsp_test.sql
94
+ - cmd : sqlcmd -S (local)\SQL2012SP1 -i Tests.NHibernate.Spatial.MsSql2012\nhsp_test.sql
91
95
92
96
# setup MySQL 5.6
93
- # - SET MYSQL_PWD=Password12!
94
- # - SET mysql="C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.exe"
95
- # - cmd /c "%mysql% -P 3306 -u root < Tests.NHibernate.Spatial.MySQL\nhsp_test.sql"
97
+ # - cmd: net start mysql56
98
+ # - cmd: SET MYSQL_PWD=Password12!
99
+ # - cmd: SET mysql="C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql.exe"
100
+ # - cmd: '%mysql% -P 3306 -u root < Tests.NHibernate.Spatial.MySQL\nhsp_test.sql'
96
101
97
102
# setup MySQL 5.7
98
- # - SET mysql="C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe"
99
- # - cmd /c "%mysql% -P 3307 -u root < Tests.NHibernate.Spatial.MySQL57\nhsp_test.sql"
103
+ # - cmd: net start mysql57
104
+ # - cmd: SET mysql="C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe"
105
+ # - cmd: '%mysql% -P 3307 -u root < Tests.NHibernate.Spatial.MySQL57\nhsp_test.sql'
100
106
101
107
# setup PostgreSQL 8.4
102
- - SET psql="C:\Program Files (x86)\PostgreSQL\8.4\bin\psql.exe"
103
- - cmd /c " %psql% -q -p 5431 -U postgres -f Tests.NHibernate.Spatial.PostGis\nhsp_test.sql"
108
+ - cmd : SET psql="C:\Program Files (x86)\PostgreSQL\8.4\bin\psql.exe"
109
+ - cmd : ' %psql% -q -p 5431 -U postgres -f Tests.NHibernate.Spatial.PostGis\nhsp_test.sql'
104
110
105
- # setup PostgreSQL 9.6
106
- - SET psql="C:\Program Files\PostgreSQL\9.6\bin\psql.exe"
107
- - cmd /c "%psql% -q -p 5432 -U postgres -f Tests.NHibernate.Spatial.PostGis20\nhsp_test.sql"
111
+ # setup PostgreSQL 9.6 on Windows
112
+ - cmd : net start postgresql-x64-9.6
113
+ - cmd : SET psql="C:\Program Files\PostgreSQL\9.6\bin\psql.exe"
114
+ - cmd : ' %psql% -q -p 5432 -U postgres -f Tests.NHibernate.Spatial.PostGis20\nhsp_test.sql'
115
+
116
+ # setup PostgreSQL 9.6 on Ubuntu
117
+ # NOTE: Need to run psql command as postgres user to prevent peer authentication failure
118
+ - sh : sudo pg_ctlcluster 9.6 main start
119
+ - sh : sudo -u postgres psql -q -p 5432 -U postgres -f Tests.NHibernate.Spatial.PostGis20/nhsp_test.sql
108
120
109
121
test_script :
110
122
- cmd : dotnet test -c Release --no-build --logger "trx;LogFileName=MsSql2008.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MsSql2008
@@ -113,16 +125,14 @@ test_script:
113
125
# - cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=MySQL.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MySQL
114
126
# - cmd: dotnet test -c Release --no-build --logger "trx;LogFileName=MySQL57.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.MySQL57
115
127
- cmd : dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis.trx" --results-directory %APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.PostGis
116
- - cmd : dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis20.trx" --results-directory % APPVEYOR_BUILD_FOLDER% Tests.NHibernate.Spatial.PostGis20
128
+ - ps : dotnet test -c Release --no-build --logger "trx;LogFileName=PostGis20.trx" --results-directory $env: APPVEYOR_BUILD_FOLDER Tests.NHibernate.Spatial.PostGis20
117
129
118
130
after_test :
119
- # NOTE: Temporary fix for test log file names - remove once new dotnet SDK version installed on AppVeyor; see:
120
- # https://github.com/Microsoft/vstest/issues/1951
121
131
- ps : $wc = New-Object 'System.Net.WebClient'
122
132
- ps : $uri = "https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)"
123
- - ps : $ wc.UploadFile($uri, (Resolve-Path MsSql2008_* .trx))
124
- - ps : $ wc.UploadFile($uri, (Resolve-Path MsSql2012_* .trx))
133
+ - ps : if ($isWindows) { $ wc.UploadFile($uri, (Resolve-Path MsSql2008 .trx)) }
134
+ - ps : if ($isWindows) { $ wc.UploadFile($uri, (Resolve-Path MsSql2012 .trx)) }
125
135
# - ps: $wc.UploadFile($uri, (Resolve-Path MySQL.trx))
126
136
# - ps: $wc.UploadFile($uri, (Resolve-Path MySQL57.trx))
127
- - ps : $ wc.UploadFile($uri, (Resolve-Path PostGis_* .trx))
128
- - ps : $wc.UploadFile($uri, (Resolve-Path PostGis20_* .trx))
137
+ - ps : if ($isWindows) { $ wc.UploadFile($uri, (Resolve-Path PostGis .trx)) }
138
+ - ps : $wc.UploadFile($uri, (Resolve-Path PostGis20 .trx))
0 commit comments