forked from SaferSocietyGroup/SleuthkitWrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azp-ci.yaml
128 lines (112 loc) · 3.87 KB
/
azp-ci.yaml
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
trigger:
- master
pool:
name: WindowsVMSS
variables:
- group: NuGetPushCredentials
- group: MagnetForensics-Github
steps:
# Checkout and run script for setting up build agent
- checkout: git://Griffeye/pipelines
- powershell: pipelines/SetupAgent.ps1
- checkout: self
clean: true
lfs: true
fetchDepth: 0
path: s # Checkout in source root folder, not a subfolder
- task: NuGetCommand@2
displayName: 'tsk-win.sln: NuGet restore'
inputs:
command: 'restore'
restoreSolution: 'Source/sleuthkit/win32/tsk-win.sln'
feedsToUse: 'select'
- task: MSBuild@1
displayName: 'tsk-win.sln: Build'
inputs:
solution: 'Source/sleuthkit/win32/tsk-win.sln'
msbuildArchitecture: 'x64'
platform: 'x64'
configuration: 'Release'
clean: true
env:
LIBEWF_HOME: $(Build.SourcesDirectory)\Source\libewf
LIBVMDK_HOME: $(Build.SourcesDirectory)\Source\libvmdk\libvmdk
LIBVHDI_HOME: $(Build.SourcesDirectory)\Source\libvhdi
- task: DotNetCoreCLI@2
displayName: 'Sleuthkit Wrapper: NuGet restore'
inputs:
command: 'restore'
projects: 'Source/Sleuthkit Wrapper'
feedsToUse: 'select'
- task: MSBuild@1
displayName: 'Sleuthkit Wrapper: Build'
inputs:
solution: 'Source/Sleuthkit Wrapper/Sleuthkit Wrapper.sln'
msbuildArchitecture: 'x64'
platform: 'x64'
configuration: 'Release'
- task: CmdLine@2
displayName: 'Tests: Copy lib files to test'
inputs:
script: |
copy "Lib\x64\libewf.dll" "Source\Sleuthkit Wrapper\unit-tests\bin\x64\Release\"
copy "Lib\x64\libvhdi.dll" "Source\Sleuthkit Wrapper\unit-tests\bin\x64\Release\"
copy "Lib\x64\libvmdk.dll" "Source\Sleuthkit Wrapper\unit-tests\bin\x64\Release\"
copy "Lib\x64\libtsk4.dll" "Source\Sleuthkit Wrapper\unit-tests\bin\x64\Release\"
copy "Lib\x64\zlib.dll" "Source\Sleuthkit Wrapper\unit-tests\bin\x64\Release\"
copy "Lib\x64\ewf.net.dll" "Source\Sleuthkit Wrapper\unit-tests\bin\x64\Release\"
copy "Source\Sleuthkit Wrapper\src\bin\x64\Release\sleuthkit-sharp.dll" "Source\Sleuthkit Wrapper\unit-tests\bin\x64\Release\"
- task: VSTest@3
displayName: 'Tests: Run'
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\unit-tests.dll
!**\*TestAdapter.dll
!**\obj\**
!**\bin\**\ref\**
searchFolder: '$(System.DefaultWorkingDirectory)'
resultsFolder: 'test-results'
diagnosticsEnabled: True
- task: NuGetCommand@2
displayName: 'NuGet pack'
inputs:
command: 'pack'
packagesToPack: 'Source\Sleuthkit Wrapper\src\NuSpec\SleuthkitSharp.nuspec'
outputDir: 'artifacts'
- task: PublishPipelineArtifact@1
displayName: 'Publish NuGet Package artifacts'
inputs:
targetPath: 'artifacts'
artifact: 'NuGet'
- powershell: dotnet nuget push artifacts\*.nupkg --skip-duplicate --source $(AnalyzePushSource) --api-key $(AnalyzeApiKey)
displayName: 'Push NuGet package'
condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'master'))
- task: NuGetCommand@2
displayName: "Nuget Push to Azure Feed"
condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'master'))
inputs:
command: 'push'
packagesToPush: 'artifacts\*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'Griffeye/Library'
allowPackageConflicts: true # --skip-duplicate
- task: PublishTestResults@2
condition: always()
inputs:
searchFolder: 'test-results'
testResultsFiles: '*.trx'
testResultsFormat: VSTest
- task: PowerShell@2
displayName: 'Push to GitHub'
condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'master'))
inputs:
targetType: 'inline'
script: |
git config user.email "Azure@Bot.com"
git config user.name "AzureDevOpsBot"
git remote remove github
git remote add github "https://$(PAT)@github.com/MagnetForensics/griffeye-sleuthkit-wrapper.git"
git push --force github HEAD:master
env:
PAT: $(PAT)