Created
December 23, 2018 19:38
-
-
Save goyalmohit/b5038972e8ff2bd165c719858cdea45f to your computer and use it in GitHub Desktop.
build docker image for dotnet core app and pushes to docker registry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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