forked from PlayFab/SDKGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
134 lines (117 loc) · 3.85 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
### NOTE: JenkinsSdkSetupScripts can't be in the root of this pipeline.
resources:
repositories:
- repository: 'JenkinsSdkSetupScripts'
type: github
endpoint: 'GitHub connection MockVMAgent'
name: PlayFab/JenkinsSdkSetupScripts
path: s/JenkinsSdkSetupScripts
trigger:
- master
- repository: API_Specs
type: github
endpoint: 'GitHub connection MockVMAgent'
name: PlayFab/API_Specs
path: s/API_Specs
trigger:
- master
- repository: CSharpSDK
type: github
endpoint: 'GitHub connection MockVMAgent'
name: PlayFab/CSharpSDK
path: s/sdks/CSharpSDK
trigger:
- master
trigger:
- master
pool:
vmImage: 'windows-latest'
steps:
- task: PowerShell@2
displayName: "Create folders for repos (workaround)"
inputs:
targetType: inline
script: |
New-Item -Path . -Name "JenkinsSdkSetupScripts" -ItemType "directory"
New-Item -Path . -Name "sdks" -ItemType "directory"
New-Item -Path . -Name "SDKGenerator" -ItemType "directory"
New-Item -Path . -Name "API_Specs" -ItemType "directory"
ls
cd sdks
New-Item -Path . -Name "CSharpSDK" -ItemType "directory"
pwsh: true
- checkout: self
clean: true
persistCredentials: true
path: s/SDKGenerator
- checkout: API_Specs
clean: true
persistCredentials: true
path: s/API_Specs
- checkout: JenkinsSdkSetupScripts
clean: true
persistCredentials: true
path: s/JenkinsSdkSetupScripts
- checkout: CSharpSDK
clean: true
persistCredentials: true
path: s/sdks/CSharpSDK
# - bash: |
# PF_TEST_TITLE_DATA_JSON="D:/a/1/s/JenkinsSdkSetupScripts/Creds/testTitleData.json"
# export PF_TEST_TITLE_DATA_JSON="$PF_TEST_TITLE_DATA_JSON"
# echo testing $PF_TEST_TITLE_DATA_JSON
# pwd
# ls
# cd ..
# pwd
# ls
# displayName: set testTilteData local environment variable
- script: |
echo testing 2 %PF_TEST_TITLE_DATA_JSON%
pwd
ls
cd SDKGenerator/SDKBuildScripts/Windows
csharp_build.bat
displayName: 'Generating CSharpSDK'
- task: NuGetCommand@2
displayName: 'Nuget Restore CSharpSDK UnitTest'
inputs:
command: 'restore'
restoreSolution: 'sdks/CSharpSDK/PlayFabSDK/PlayFabSDK+Unit.sln'
feedsToUse: 'select'
- task: VSBuild@1
displayName: 'Build CSharpSDKUnitTest: Release'
inputs:
solution: 'sdks/CSharpSDK/PlayFabSDK/PlayFabSDK+Unit.sln'
configuration: 'Release'
clean: true
msbuildArchitecture: 'x64'
- bash: |
echo bash pf title data is $PF_TEST_TITLE_DATA_JSON
if [ -f "$PF_TEST_TITLE_DATA_JSON" ]; then
echo pf test title file exists! according to bash
else
echo THE PF TITLE FILE DOES NOT EXIST
fi
displayName: Test For TestTitle Data Json
# note this doesn't seem to print anything out?
# without cmd <<< bash will not find dotnet (script didn't seem to work?)
- bash: |
cd sdks/CSharpSDK/PlayFabSDK/UnittestRunner/bin/Release/netcoreapp2.0/
echo START NetCore 2.0 UNIT TEST RUNNER with this file: $PF_TEST_TITLE_DATA_JSON
cmd <<< dotnet .\UnitTestRunner.dll -testInputsFile '$PF_TEST_TITLE_DATA_JSON'
displayName: 'TEST BASH NetCore 2.0 CSharpSDK UnitTestRunner (expected blank)'
# possible alternative to call a dll? Or we could try powershell?
# - script: |
# cd sdks/CSharpSDK/PlayFabSDK/UnittestRunner/bin/Release/netcoreapp2.0/
# echo START NetCore 2.0 UNIT TEST RUNNER with this file: %PF_TEST_TITLE_DATA_JSON%
# dotnet .\UnitTestRunner.dll -testInputsFile '%PF_TEST_TITLE_DATA_JSON%'
# displayName: 'TEST SCRIPT NetCore 2.0 CSharpSDK UnitTestRunner'
- bash: |
cd sdks/CSharpSDK/PlayFabSDK/UnittestRunner/bin/Release/net45/
pwd
ls
echo START .Net4.5 UNIT TEST RUNNER
echo windows script testing this var $PF_TEST_TITLE_DATA_JSON
cmd <<< UnitTestRunner.exe -testInputsFile '$PF_TEST_TITLE_DATA_JSON'
displayName: 'dotNet 45 CSharpSDK UnitTestRunner'