2018-11-05 12:08:36 +03:00
|
|
|
# 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
|
2018-09-27 10:30:03 +03:00
|
|
|
|
2018-11-05 12:08:36 +03:00
|
|
|
name: $(build.sourceBranchName)-$(Date:yyyyMMdd)$(Rev:.r)
|
2018-09-27 10:30:03 +03:00
|
|
|
pool:
|
|
|
|
vmImage: 'Ubuntu 16.04'
|
|
|
|
|
2018-11-05 12:08:36 +03:00
|
|
|
variables:
|
2018-11-05 13:12:15 +03:00
|
|
|
imageName: '$(dockerId)/site'
|
2018-11-05 12:08:36 +03:00
|
|
|
|
2019-06-28 21:23:14 +03:00
|
|
|
trigger:
|
|
|
|
batch: true
|
|
|
|
branches:
|
|
|
|
include:
|
2019-06-28 21:29:25 +03:00
|
|
|
- aksworkshop-master
|
|
|
|
- aksworkshop-staging
|
2019-06-28 21:23:14 +03:00
|
|
|
|
2019-06-28 21:22:00 +03:00
|
|
|
# no PR builds
|
|
|
|
pr: none
|
|
|
|
|
2018-09-27 10:30:03 +03:00
|
|
|
steps:
|
2019-06-28 21:22:00 +03:00
|
|
|
- script: sed -i 's/#BUILD_ID#/$(build.buildNumber)/g' _includes/nav.html
|
|
|
|
displayName: 'update site with build number'
|
|
|
|
|
|
|
|
- script: sed -i 's/#COMMIT_ID#/$(build.SourceVersion)/g' _includes/nav.html
|
2018-11-08 15:15:33 +03:00
|
|
|
displayName: 'update site with build number'
|
|
|
|
|
2018-11-05 12:08:36 +03:00
|
|
|
- script: docker build -f Dockerfile -t $(imageName) .
|
|
|
|
displayName: 'docker build'
|
|
|
|
|
|
|
|
- script: docker login -u $(dockerId) -p $(dockerPassword)
|
|
|
|
displayName: 'docker login'
|
2018-09-27 10:30:03 +03:00
|
|
|
|
2018-11-05 12:08:36 +03:00
|
|
|
- script: |
|
|
|
|
docker tag $(imageName) $(imageName):$(build.buildNumber)
|
|
|
|
docker push $(imageName):$(build.buildNumber)
|
|
|
|
displayName: 'docker push with build number'
|