This repository has been archived by the owner on Mar 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines-ext.yml
70 lines (59 loc) · 2.13 KB
/
azure-pipelines-ext.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
trigger:
- ext
pr: none
pool:
vmImage: 'Ubuntu-16.04'
variables:
- group: hwsc-dev-container-vars
- group: hwsc-file-transaction-svc-env-vars
strategy:
matrix:
Python37:
python.version: '3.7'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
displayName: 'Use Python $(python.version)'
- script: |
wget https://bootstrap.pypa.io/get-pip.py
python3.7 get-pip.py
pip3.7 install pipenv
pipenv install --dev -v
displayName: 'Install Dependencies'
- script: |
export hosts_file_address=""
export hosts_file_port="50053"
export hosts_file_network="tcp"
export hosts_blob_storage=$(testBlobStorage)
mkdir azurite
docker pull arafato/azurite
docker run -t -d -p 10000:10000 -p 10001:10001 -p 10002:10002 -v azurite:/opt/azurite/folder arafato/azurite
pipenv run pytest --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html
displayName: 'Run Unit Test'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: '$(System.DefaultWorkingDirectory)/**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
failTaskOnFailedTests: 'true'
failOnStandardError: 'true'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
failIfCoverageEmpty: 'true'
failOnStandardError: 'true'
- task: DownloadSecureFile@1
inputs:
secureFile: hwscdevcontainer_pw.txt
- script: |
cat $(Agent.TempDirectory)/hwscdevcontainer_pw.txt | docker login -u "$(hwscDevContainerUser)" --password-stdin
secureFile: hwscdevcontainer_pw.txt
docker build --no-cache -f Dockerfile -t hwsc/hwsc-file-transaction-svc:ext .
displayName: 'Build Docker Image Internal Release'
- script: |
docker push hwsc/hwsc-file-transaction-svc:ext
displayName: 'Push Docker Image Internal Release'