Closed spboyer closed 4 years ago
# Docker image # Build a Docker image to deploy, run, or push to a container registry. # Add steps that use Docker Compose, tag images, push to a registry, run an image, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/docker trigger: - master - greenkeeper/* pool: vmImage: 'Ubuntu-16.04' variables: imageName: 'social-linker:$(build.buildId)' dockerId: 'shayne' latest: 'social-linker:latest' steps: - task: Bash@3 inputs: targetType: 'inline' script: 'docker build -f Dockerfile -t $(imageName) .' - task: Bash@3 condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) inputs: targetType: 'inline' script: | docker build -t $(dockerId).azurecr.io/$(imageName) . docker login -u $(dockerId) -p $(dockerPassword) $(dockerId).azurecr.io docker push $(dockerId).azurecr.io/$(imageName) displayName: 'pushing image to azurecr' - task: AzureWebAppContainer@1 condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) inputs: azureSubscription: 'Azure-shboyer' appName: 'social-linker' imageName: '$(dockerId).azurecr.io/$(imageName)'
Closed with https://github.com/spboyer/advocate-linkers/commit/3e944986f274b9a22255ff1e242e66a3d18faf20