forked from Mimetis/Dotmim.Sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
156 lines (128 loc) · 7.14 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
jobs:
- job: Tests
pool:
# get an Ubuntu image to be able to get the light SQL container
vmImage: "Ubuntu 16.04" # 'VS2017-Win2016'
variables:
solution: "**/*.sln"
buildPlatform: "Any CPU"
buildConfiguration: "Release"
steps:
# Seems the 3306 is already in use on the machine used by Azure Devops, so redirect to 3307
- script: docker run --name mysql -e MYSQL_ROOT_PASSWORD=Password12! -p 3307:3306 -d mysql
displayName: "Run MySql on Linux container"
# - script: echo "##vso[task.setvariable variable=mySQLIP;isOutput=true]$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" mysql)"
# name: setvarStep
# displayName: '[obsolete] Get Ip from MySql container'
- script: docker run --name sqlserver -e ACCEPT_EULA=Y -e SA_PASSWORD=Password12! -p 1433:1433 -d mcr.microsoft.com/mssql/server
displayName: "Run SQL 2017 on Linux container"
#- script: |
# sqlcmd -S localhost -U sa -P 'Password12!' -Q 'select @@VERSION'
# exit
# continueOnError: 'true'
# displayName: 'Run SQLCMD, Continue if any error'
# Dont need anymore to pass the MySQL Ip Address, just let it here for memory
# --logger trx;logfilename=TEST.xml : Unexplained arg to publish tests resuls
- script: dotnet test Tests/Dotmim.Sync.Tests/Dotmim.Sync.Tests.csproj --filter SqlServerBasicTests --logger trx
name: SqlServerBasicTests
displayName: "Tests with SQL Server acting as server"
env:
"MYSQLIP": $(setvarStep.mySQLIP)
"AZUREDEV": "true"
- script: dotnet test Tests/Dotmim.Sync.Tests/Dotmim.Sync.Tests.csproj --filter SyncAllColumnsTests --logger trx
name: SyncAllColumnsTests
displayName: "Tests with SQL Server acting as server and all columns possibilities"
env:
"MYSQLIP": $(setvarStep.mySQLIP)
"AZUREDEV": "true"
- script: dotnet test Tests/Dotmim.Sync.Tests/Dotmim.Sync.Tests.csproj --filter SqlServerConfigTests --logger trx
name: SqlServerConfigTests
displayName: "Tests with SQL Server acting as server and specific configurations"
env:
"MYSQLIP": $(setvarStep.mySQLIP)
"AZUREDEV": "true"
- script: dotnet test Tests/Dotmim.Sync.Tests/Dotmim.Sync.Tests.csproj --filter SqlServerFilterTests --logger trx
name: SqlServerFilterTests
displayName: "Tests with SQL Server acting as server and specific filters"
env:
"MYSQLIP": $(setvarStep.mySQLIP)
"AZUREDEV": "true"
- script: dotnet test Tests/Dotmim.Sync.Tests/Dotmim.Sync.Tests.csproj --filter MySqlBasicTests --logger trx
name: MySqlBasicTests
displayName: "Tests with MySQL Server acting as server"
env:
"MYSQLIP": $(setvarStep.mySQLIP)
"AZUREDEV": "true"
- script: dotnet test Tests/Dotmim.Sync.Tests/Dotmim.Sync.Tests.csproj --filter MySqlFilterTests --logger trx
name: MySqlFilterTests
displayName: "Tests with MySQL Server acting as server"
env:
"MYSQLIP": $(setvarStep.mySQLIP)
"AZUREDEV": "true"
- task: PublishTestResults@2
inputs:
testRunner: VSTest
testResultsFiles: "**/*.trx"
- job: Beta
# dependsOn: Tests
# condition: succeeded('Tests')
# Pool on a VS 2017 image to be able to compile for .Net 4.6
pool:
vmImage: "VS2017-Win2016"
variables:
buildConfiguration: "Release"
buildBetaId: "beta-"
artifactName: "drop"
steps:
- bash: |
build=$(Build.BuildId)
lenbuild=${#build}
if [ $lenbuild -eq 1 ]; then
build="000$build"
elif [ $lenbuild -eq 2 ]; then
build="00$build"
elif [ $lenbuild -eq 3 ]; then
build="0$build"
fi
echo "##vso[task.setvariable variable=buildBetaId]$(buildBetaId)$build"
- script: |
echo $(buildIdString)
echo $(buildBetaId)
dotnet --version
displayName: Get dotnet version
- script: |
dotnet build Projects/Dotmim.Sync.Core/Dotmim.Sync.Core.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/Dotmim.Sync.Core --version-suffix $(buildBetaId)
dotnet build Projects/Dotmim.Sync.SqlServer/Dotmim.Sync.SqlServer.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/Dotmim.Sync.SqlServer --version-suffix $(buildBetaId)
dotnet build Projects/Dotmim.Sync.Sqlite/Dotmim.Sync.Sqlite.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/Dotmim.Sync.Sqlite --version-suffix $(buildBetaId)
dotnet build Projects/Dotmim.Sync.MySql/Dotmim.Sync.MySql.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/Dotmim.Sync.MySql --version-suffix $(buildBetaId)
dotnet build Projects/Dotmim.Sync.Web.Client/Dotmim.Sync.Web.Client.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/Dotmim.Sync.Web.Client --version-suffix $(buildBetaId)
dotnet build Projects/Dotmim.Sync.Web.Server/Dotmim.Sync.Web.Server.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/Dotmim.Sync.Web.Server --version-suffix $(buildBetaId)
dotnet build Projects/dotnet-sync/dotnet-sync.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/dotnet-sync --version-suffix $(buildBetaId)
displayName: "Compile binaries and get beta nuget packages"
# Publish Build Artifacts
- task: PublishBuildArtifacts@1
inputs:
artifactName: $(artifactName)
- job: Release
# dependsOn: Tests
# condition: succeeded('Tests')
# Pool on a VS 2017 image to be able to compile for .Net 4.6
pool:
vmImage: "VS2017-Win2016"
variables:
buildConfiguration: "Release"
artifactName: "release"
steps:
- script: |
dotnet build Projects/Dotmim.Sync.Core/Dotmim.Sync.Core.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/Dotmim.Sync.Core
dotnet build Projects/Dotmim.Sync.SqlServer/Dotmim.Sync.SqlServer.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/Dotmim.Sync.SqlServer
dotnet build Projects/Dotmim.Sync.Sqlite/Dotmim.Sync.Sqlite.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/Dotmim.Sync.Sqlite
dotnet build Projects/Dotmim.Sync.MySql/Dotmim.Sync.MySql.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/Dotmim.Sync.MySql
dotnet build Projects/Dotmim.Sync.Web.Client/Dotmim.Sync.Web.Client.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/Dotmim.Sync.Web.Client
dotnet build Projects/Dotmim.Sync.Web.Server/Dotmim.Sync.Web.Server.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/Dotmim.Sync.Web.Server
dotnet build Projects/dotnet-sync/dotnet-sync.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/dotnet-sync
displayName: "Compile binaries and get release nuget packages"
# Publish Build Artifacts
- task: PublishBuildArtifacts@1
inputs:
artifactName: $(artifactName)