Skip to content

Commit

Permalink
Update azure-pipeline.yaml for Azure Pipelines (Azure-Samples#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgbradley1 authored Jul 3, 2024
1 parent e71e132 commit c3f0714
Showing 1 changed file with 36 additions and 24 deletions.
60 changes: 36 additions & 24 deletions .azdo/azure-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
trigger:
- main

pool:
vmImage: ubuntu-latest
# the `resources` specify the location and version of the 1ES Pipeline Template (PT).
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

steps:
# Component Governance does not support pyproject.toml yet.
# For that 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'
- task: ComponentGovernanceComponentDetection@0
displayName: 'Component Governance - Component Detection'
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
# - task: PoliCheck@2
# displayName: 'Run PoliCheck'
# inputs:
# targetType: 'F'
# targetArgument: '$(Build.SourcesDirectory)'
# result: 'PoliCheck.xml'
# toolVersion: Latest
extends:
# this pipeline extends an existing 1ES PT which injects various SDL and compliance tasks
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool:
name: OCTO1ES_HostedPool
image: SMTOCTO1ESAgentWindowsVM
os: windows
sdl:
skipComponentGovernanceDetection: false
policheck:
enabled: true
sourceAnalysisPool:
name: OCTO1ES_HostedPool
image: SMTOCTO1ESAgentWindowsVM
os: windows
stages:
- stage: Component_Governance
jobs:
- job: CG_Prep
steps:
# 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'

0 comments on commit c3f0714

Please sign in to comment.