Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
Add release build for MMI and restructure CI build (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapatwardhan authored Jul 2, 2019
1 parent 233fd52 commit 8069b24
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 38 deletions.
19 changes: 19 additions & 0 deletions .vsts-ci/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: MMI-$(Build.BuildId)
trigger:
branches:
include:
- master
- release*
pr:
branches:
include:
- master
- release*

pool:
vmImage: 'ubuntu-latest'

steps:
- template: templates/build.yml

- template: templates/test.yml
24 changes: 24 additions & 0 deletions .vsts-ci/releaseBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: MMI-$(Build.BuildId)
trigger:
branches:
include:
- master
- release*
pr:
branches:
include:
- master
- release*

jobs:

- job: build_MMI
displayName: Build MMI
pool:
vmImage: 'ubuntu-latest'
steps:
- template: templates/build.yml

- template: templates/compliance.yml
parameters:
parentJob: build_MMI
18 changes: 18 additions & 0 deletions .vsts-ci/templates/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
steps:
- checkout: self

- bash: sudo apt-get install libpam0g-dev libssl-dev libcurl4-openssl-dev
displayName: 'apt-get dependencies'

- bash: ./build.sh
displayName: 'Build MMI'

- task: PublishBuildArtifacts@1
inputs:
artifactName: 'release'
pathToPublish: src/Microsoft.Management.Infrastructure/bin/Microsoft.Management.Infrastructure.dll

- task: PublishBuildArtifacts@1
inputs:
artifactName: 'release'
pathToPublish: src/Microsoft.Management.Infrastructure/bin/Microsoft.Management.Infrastructure.pdb
83 changes: 83 additions & 0 deletions .vsts-ci/templates/compliance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
parameters:
parentJob: build

jobs:
- job: compliance
displayName: Compliance for MMI
pool:
name: Package ES CodeHub Lab E
dependsOn:
${{ parameters.parentJob }}

steps:
- task: DownloadBuildArtifacts@0
displayName: 'Download artifacts'
inputs:
buildType: current
downloadType: single
artifactName: release
downloadPath: '$(System.ArtifactsDirectory)'

- task: securedevelopmentteam.vss-secure-development-tools.build-task-antimalware.AntiMalware@3
displayName: 'Run Defender Scan'

- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
displayName: 'Run CredScan'
inputs:
debugMode: false
continueOnError: true

- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3
displayName: 'Run BinSkim '
inputs:
InputType: Basic
AnalyzeTarget: '$(System.ArtifactsDirectory)/*.dll'
AnalyzeSymPath: 'SRV*'
AnalyzeVerbose: true
AnalyzeHashes: true
AnalyzeStatistics: true
continueOnError: true

- task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@1
displayName: 'Run PoliCheck'
inputs:
targetType: F
optionsFC: 0
optionsXS: 0
optionsPE: '1|2|3|4'
optionsHMENABLE: 0
toolVersion: 5.8.2.1
continueOnError: true

- task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2
displayName: 'Publish Security Analysis Logs to Build Artifacts'
continueOnError: true

- task: securedevelopmentteam.vss-secure-development-tools.build-task-uploadtotsa.TSAUpload@1
displayName: 'TSA upload to Codebase: MMI_20190701 Version: TsaV2'
inputs:
tsaVersion: TsaV2
codeBaseName: 'MMI_20190701'
uploadAPIScan: false
uploadFortifySCA: false
uploadFxCop: false
uploadModernCop: false
uploadPREfast: false
uploadRoslyn: false
uploadTSLint: false

- task: securedevelopmentteam.vss-secure-development-tools.build-task-report.SdtReport@1
displayName: 'Create Security Analysis Report'
inputs:
TsvFile: false
APIScan: true
BinSkim: true
CredScan: true
PoliCheck: true
PoliCheckBreakOn: Severity2Above

- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'
inputs:
sourceScanPath: '$(Build.SourcesDirectory)'
snapshotForceEnabled: true
9 changes: 9 additions & 0 deletions .vsts-ci/templates/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
steps:
- bash: ./test.sh
displayName: 'Execute Tests'

- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '**/*TestResults.trx'
failTaskOnFailedTests: 'true'
38 changes: 0 additions & 38 deletions azure-pipelines.yml

This file was deleted.

0 comments on commit 8069b24

Please sign in to comment.