forked from MicrosoftDocs/pipelines-dotnet-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.acr.yml
31 lines (27 loc) · 1.1 KB
/
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
31
# Build Docker image for this app using Azure Pipelines
# http://docs.microsoft.com/azure/devops/pipelines/languages/docker?view=vsts
pool:
vmImage: 'Ubuntu 16.04'
variables:
buildConfiguration: 'Release'
imageName: 'dotnetcore:$(Build.BuildId)'
# define two more variables dockerId and dockerPassword in the build pipeline in UI
steps:
- script: |
dotnet build --configuration $(buildConfiguration)
dotnet test dotnetcore-tests --configuration $(buildConfiguration) --logger trx
dotnet publish --configuration $(buildConfiguration) --output out
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:
testRunner: VSTest
testResultsFiles: '**/*.trx'
#- script: |
# docker-compose -f docs/docker-compose.yml --project-directory . -p docs up -d |
# docker wait docs_sut_1 |
# docker-compose -f docs/docker-compose.yml --project-directory . down