Last active
June 25, 2019 22:50
-
-
Save juliuscanute/c59cb676fbfd79e483c5a1ddd7080c6f to your computer and use it in GitHub Desktop.
Azure Pipeline
This file contains 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
pool: | |
vmImage: 'ubuntu-latest' | |
variables: | |
imageName: spring-demo | |
steps: | |
- task: Maven@3 | |
inputs: | |
mavenPomFile: 'pom.xml' | |
options: '-Dspring.profiles.active=dev' | |
mavenOptions: '-Xmx3072m' | |
javaHomeOption: 'JDKVersion' | |
jdkVersionOption: '1.8' | |
jdkArchitectureOption: 'x64' | |
publishJUnitResults: false | |
testResultsFiles: '**/surefire-reports/TEST-*.xml' | |
goals: 'package' | |
- script: | | |
echo Build docker image | |
docker build -t $username.azurecr.io/$(imageName):$(Build.BuildNumber) . | |
echo Login to docker repository | |
docker login -u $username -p $password $username.azurecr.io | |
echo Push docker image | |
docker push $username.azurecr.io/$(imageName):$(Build.BuildNumber) | |
displayName: 'Build and Push Docker Image' | |
env: | |
username: $(acrUsername) | |
password: $(acrPassword) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment