-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml.tmpl
58 lines (46 loc) · 1.26 KB
/
azure-pipelines.yml.tmpl
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
pool:
vmImage: 'Ubuntu-18.04'
trigger:
branches:
include:
- master
variables:
imageName: 'wordpress-docker-updater'
acrName: 'mycontainerreg'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
- script: python -m pip install --upgrade pip coverage
displayName: 'Install or upgrade pip and test-coverage tool'
- script: pip install -r requirements.txt
displayName: 'Install requirements'
- script: python -m unittest discover . "*_test.py"
displayName: 'run unit-tests'
- task: Docker@2
inputs:
containerRegistry: '$(acrName)'
repository: '$(imageName)'
command: 'build'
Dockerfile: '**/Dockerfile'
tags: |
$(Build.BuildNumber)
latest
- task: Docker@2
inputs:
containerRegistry: '$(acrName)'
repository: '$(imageName)'
command: 'push'
tags: |
$(Build.BuildNumber)
latest
- script: coverage run --branch --source=wp -m unittest discover . "*_test.py"
displayName: 'determine unit-tests coverage'
- script: coverage xml
displayName: 'generate coverage-report'
- task: SonarQubePrepare@4
inputs:
SonarQube: 'sonar-qube'
scannerMode: 'CLI'
configMode: 'file'
- task: SonarQubeAnalyze@4