-
Notifications
You must be signed in to change notification settings - Fork 21
/
azure-pipelines.yml
125 lines (106 loc) · 3.69 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
trigger:
batch: true
branches:
include:
- main
pr:
branches:
include:
- main
schedules:
- cron: '0 0 * * 0'
displayName: Weekly build
branches:
include:
- main
always: true
resources:
repositories:
- repository: OpsGuildAutomationRepo
type: git
name: Engineering/OpsGuild.Automation
ref: refs/heads/main
- repository: OpsGuildPipelineTools
type: git
name: Engineering/opsguild.pipeline-tools
ref: refs/heads/main
- repository: templates
type: github
name: osisoft/OSI-Samples
endpoint: osisoft/OSI-Samples
variables:
- template: '/miscellaneous/build_templates/variables.yml@templates'
- name: analysisProject
value: PI_AFGSG_DotNet
- name: run_import
value: false
- name: run_delete
value: false
jobs:
- job: Tests
pool:
name: 00-OSIManaged-Containers
demands: Agent.OS -equals Windows_NT
variables:
- name: AFDatabaseName
value: $(AFDatabaseNameAFGSG)
steps:
- checkout: self
- checkout: OpsGuildPipelineTools
- template: '/miscellaneous/build_templates/appsettings.yml@templates'
parameters:
secrets: 'AFServerName, AFDatabaseNameAFGSG'
- template: '/Templates/Utilities/InstallAFSDK.step.v0.yml@OpsGuildPipelineTools'
- script: |
for /D %%a in (".\*.*") do xcopy /y /d appsettings.json "%%a\"
displayName: 'copy file to subfolders'
workingDirectory: $(Build.SourcesDirectory)\AF-SDK-Getting-Started-Guide
- script: |
"%pihome64%\af\afimport" "\\OCSSAMPLESAPI01\Green Power Company" /F:"AF Database - Green Power Company.xml" /P
condition: eq(variables.run_import, true)
displayName: 'import database2'
workingDirectory: $(Build.SourcesDirectory)\AF-SDK-Getting-Started-Guide
- script: |
nuget restore
displayName: 'Nuget restore'
workingDirectory: $(Build.SourcesDirectory)\AF-SDK-Getting-Started-Guide
- task: DotNetCoreCLI@2
displayName: 'Run tests'
inputs:
command: test
arguments: --filter Category=Solution
publishTestResults: true
testRunTitle: '$(Agent.JobName) on $(Agent.OS)'
projects: '$(Build.SourcesDirectory)\AF-SDK-Getting-Started-Guide\Getting-Started-With-PI-AF-SDK.sln'
- task: DotNetCoreCLI@2
displayName: 'Run Delete'
condition: eq(variables.run_delete, true)
inputs:
command: test
arguments: --filter Category=Delete
publishTestResults: true
testRunTitle: '$(Agent.JobName) on $(Agent.OS) (Delete)'
- template: '/miscellaneous/build_templates/code-analysis.yml@templates'
parameters:
projectPath: '\AF-SDK-Getting-Started-Guide'
buildSteps:
- checkout: self
- checkout: OpsGuildPipelineTools
- template: '/Templates/Utilities/InstallAFSDK.step.v0.yml@OpsGuildPipelineTools'
- template: '/miscellaneous/build_templates/appsettings.yml@templates'
- script: |
for /D %%a in (".\*.*") do xcopy /y /d appsettings.json "%%a\"
displayName: 'copy file to subfolders'
workingDirectory: $(Build.SourcesDirectory)\AF-SDK-Getting-Started-Guide
- task: NuGetCommand@2
displayName: 'nuget restore'
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
- task: VSBuild@1
displayName: 'Build solution'
inputs:
vsVersion: 16.0
- template: '/miscellaneous/build_templates/binskim.yml@templates'
parameters:
deleteBinSkim: 'AFSDKInstallKit/*'