Skip to content

Instantly share code, notes, and snippets.

@juliuscanute
Last active June 25, 2019 22:50
Show Gist options
  • Save juliuscanute/c59cb676fbfd79e483c5a1ddd7080c6f to your computer and use it in GitHub Desktop.
Save juliuscanute/c59cb676fbfd79e483c5a1ddd7080c6f to your computer and use it in GitHub Desktop.
Azure Pipeline
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