Update azure-pipeline.yaml for Azure Pipelines (#46)

This commit is contained in:
Josh Bradley 2024-07-03 17:39:06 -04:00 committed by GitHub
parent e71e132524
commit c3f071470f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,28 +1,40 @@
trigger: trigger:
- main - main
pool: # the `resources` specify the location and version of the 1ES Pipeline Template (PT).
vmImage: ubuntu-latest resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
steps: extends:
# Component Governance does not support pyproject.toml yet. # this pipeline extends an existing 1ES PT which injects various SDL and compliance tasks
# For that reason, use toml-to-requirements to export dependencies into a requirements.txt file. template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
- script: | parameters:
pip install toml-to-requirements pool:
toml-to-req --toml-file pyproject.toml --poetry --optional-lists dev,test,backend,frontend name: OCTO1ES_HostedPool
# toml-to-req is not perfect. It will leave wildcard characters in the requirements.txt file which we remove image: SMTOCTO1ESAgentWindowsVM
sed -i 's/\*//g' requirements.txt os: windows
displayName: 'Export python dependencies to requirements.txt' sdl:
- task: ComponentGovernanceComponentDetection@0 skipComponentGovernanceDetection: false
displayName: 'Component Governance - Component Detection' policheck:
inputs: enabled: true
scanType: 'Register' sourceAnalysisPool:
verbosity: 'Verbose' name: OCTO1ES_HostedPool
alertWarningLevel: 'High' image: SMTOCTO1ESAgentWindowsVM
# - task: PoliCheck@2 os: windows
# displayName: 'Run PoliCheck' stages:
# inputs: - stage: Component_Governance
# targetType: 'F' jobs:
# targetArgument: '$(Build.SourcesDirectory)' - job: CG_Prep
# result: 'PoliCheck.xml' steps:
# toolVersion: Latest # Component Governance does not support pyproject.toml yet.
# for this reason, use toml-to-requirements to export dependencies into a requirements.txt file.
- script: |
pip install toml-to-requirements
toml-to-req --toml-file pyproject.toml --poetry --optional-lists dev,test,backend,frontend
# toml-to-req is not perfect. It will leave wildcard characters in the requirements.txt file which we remove
sed -i 's/\*//g' requirements.txt
displayName: 'Export python dependencies to requirements.txt for CG'