-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcatalogSourced-TestAndPromote.yml
57 lines (56 loc) · 2.58 KB
/
catalogSourced-TestAndPromote.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
parameters:
RuleAppName: 'UNSET'
SourceCatalogName: 'UNSET'
DestinationCatalogName: 'UNSET'
jobs:
- job: Test_${{ parameters.RuleAppName }}
pool:
vmImage: 'windows-2019'
variables:
#- group: SourceCatCredsFor$(SourceCatalogName) This is not yet supported - https://github.com/MicrosoftDocs/vsts-docs/issues/3702
- group: SourceCatCredsForDev
- name: RuleAppName
value: ${{ parameters.RuleAppName }}
- name: RuleTestFolder
value: $(System.DefaultWorkingDirectory)\catalogSourced-TestAndPromote TestSuites\$(RuleAppName)
steps:
- task: DownloadSecureFile@1
inputs:
secureFile: 'InRuleLicense.xml'
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)/Helpers/ExecuteTests'
Contents: '**'
TargetFolder: '$(Agent.TempDirectory)'
OverWrite: true
- script: |
for %%i in ("$(RuleTestFolder)\*.testsuite") do ( echo Running TestSuitePath:"%%i" )
for %%i in ("$(RuleTestFolder)\*.testsuite") do ( .\ExecuteTests.exe -TestSuitePath:"%%i" -CatUri:"$(SourceCatalogUri)" -CatUsername:"$(SourceCatalogUsername)" -CatPassword:"$(SourceCatalogPassword)" -CatRuleAppName:"$(RuleAppName)")
displayName: 'Run Tests on $(RuleAppName) Rule App'
workingDirectory: $(Agent.TempDirectory)
- job: Promote_${{ parameters.RuleAppName }}
dependsOn: Test_${{ parameters.RuleAppName }}
pool:
vmImage: 'windows-2019'
variables:
##- group: SourceCatCredsFor$(SourceCatalogName) This is not yet supported - https://github.com/MicrosoftDocs/vsts-docs/issues/3702
#- group: DestCatCredsFor$(DestinationCatalogName) This is not yet supported - https://github.com/MicrosoftDocs/vsts-docs/issues/3702
- group: SourceCatCredsForDev
- group: DestCatCredsForUAT
- name: RuleAppName
value: ${{ parameters.RuleAppName }}
steps:
- task: DownloadSecureFile@1
inputs:
secureFile: 'InRuleLicense.xml'
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)/Helpers/PromoteRuleApp'
Contents: '**'
TargetFolder: '$(Agent.TempDirectory)'
OverWrite: true
- script: |
echo Promoting Rule App from $(SourceCatalogUri) to $(DestinationCatalogUri)
.\PromoteRuleApp.exe -RuleAppName:"$(RuleAppName)" -Comment:"Publish from command line tool" -SrcCatUri:"$(SourceCatalogUri)/core" -SrcCatUser:"$(SourceCatalogUsername)" -SrcCatPass:"$(SourceCatalogPassword)" -DestCatUri:"$(DestinationCatalogUri)/core" -DestCatUser:"$(DestinationCatalogUsername)" -DestCatPass:"$(DestinationCatalogPassword)"
displayName: 'Promote $(RuleAppName)'
workingDirectory: $(Agent.TempDirectory)