-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
70 lines (58 loc) · 1.67 KB
/
azure-pipelines.yml
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
resources:
- repo: self
jobs:
#Multi-configuration and multi-agent job options are not exported to YAML. Configure these options using documentation guidance: https://docs.microsoft.com/vsts/pipelines/process/phases
- job: Phase_1
displayName: Build and Test
condition: succeeded()
pool:
vmImage: 'Ubuntu 16.04'
variables:
python.version: '3.6.5, 3.7.0'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python $(python.version)'
inputs:
versionSpec: '$(python.version)'
- script: |
pip install pipenv
pipenv install -d --system --deploy --ignore-pipfile
displayName: 'Install dependencies'
- script: |
pip install typed_ast
make lint
displayName: Lint
continueOnError: true
- script: |
pip install pathlib2
make test
displayName: Pytest
- task: PublishTestResults@2
displayName: 'Publish Test Results **/test-results.xml'
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
- job: Phase_2
displayName: Publish
dependsOn: Phase_1
condition: succeeded()
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python >= 3.7'
inputs:
versionSpec: '>= 3.7'
- task: Docker@1
displayName: Build
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'Dockerhub connection'
imageName: 'menziess/flask-api:latest'
- task: Docker@1
displayName: Push
inputs:
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: 'Dockerhub connection'
command: 'Push an image'
imageName: 'menziess/flask-api:latest'