Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
do not tag/push latest as best practice
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu-benoit committed Jun 20, 2019
1 parent 7b0e819 commit 9c60915
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions nodebrady/azure-build-pipeline.yml
Expand Up @@ -18,16 +18,12 @@ variables:


steps:
- bash: docker build -f $(system.defaultWorkingDirectory)/$(projectName)/Dockerfile -t $(registryServerName)/$(imageName):$(build.buildId) -t $(registryServerName)/$(imageName):latest $(system.defaultWorkingDirectory)/$(projectName)
- bash: docker build -f $(system.defaultWorkingDirectory)/$(projectName)/Dockerfile -t $(registryServerName)/$(imageName):$(build.buildId) $(system.defaultWorkingDirectory)/$(projectName)
displayName: 'docker build'

- bash: docker login $(registryServerName) -u $(registryLogin) -p $(registryPassword)
displayName: 'docker login'
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))

- bash: |
docker login $(registryServerName) -u $(registryLogin) -p $(registryPassword)
docker push $(registryServerName)/$(imageName):$(build.buildId)
docker push $(registryServerName)/$(imageName):latest
displayName: 'docker push'
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))

Expand Down

0 comments on commit 9c60915

Please sign in to comment.