forked from MicrosoftDocs/pipelines-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.acr.yml
30 lines (26 loc) · 975 Bytes
/
azure-pipelines.acr.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
# Build Docker image for this app using Azure Pipelines
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker?view=vsts
pool:
vmImage: 'Ubuntu 16.04'
variables:
imageName: 'nodejssample:$(Build.BuildId)'
# define two more variables dockerId and dockerPassword in the build pipeline in UI
steps:
- script: |
npm install
npm test
docker build -f Dockerfile -t $(dockerId).azurecr.io/$(imageName) .
docker login -u $(dockerId) -p $pswd $(dockerId).azurecr.io
docker push $(dockerId).azurecr.io/$(imageName)
env:
pswd: $(dockerPassword)
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/TEST-RESULTS.xml'
testRunTitle: 'Test results for JavaScript'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/coverage'