Skip to content

Instantly share code, notes, and snippets.

@goyalmohit
Created December 23, 2018 19:38
Show Gist options
  • Save goyalmohit/b5038972e8ff2bd165c719858cdea45f to your computer and use it in GitHub Desktop.
Save goyalmohit/b5038972e8ff2bd165c719858cdea45f to your computer and use it in GitHub Desktop.
build docker image for dotnet core app and pushes to docker registry
# Build Docker image for this app using Azure Pipelines
pool:
name: 'dockerized-vsts-agents'
variables:
buildConfiguration: 'Release'
imageName: 'dotnetcore:$(Build.BuildId)'
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)/$(imageName) .
docker login -u $(dockerUser) -p $pswd $(dockerId)
docker push $(dockerId)/$(imageName)
env:
pswd: $(dockerPassword)
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment