-
Notifications
You must be signed in to change notification settings - Fork 5
/
azure-pipelines.yml
47 lines (43 loc) · 1.23 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Docker
# Build a Docker image
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- main
resources:
- repo: self
variables:
tag: '$(Build.BuildId)'
tagDate: $[ format('{0:yyyy}.{0:MM}.{0:dd}.{0:HH}.{0:mm}{0:ss}', pipeline.startTime) ]
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
stages:
- stage: Build
condition: and(succeeded(), eq(variables.isMain, 'true'))
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: ubuntu-latest
steps:
- task: Docker@2
displayName: Build an image and Push
inputs:
command: buildAndPush
dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
tags: |
latest
$(tagDate)
containerRegistry: DockerHub
repository: dbcawa/feewaiver
env:
DOCKER_BUILDKIT: 1
- task: Docker@2
displayName: Dev Build image and Push
inputs:
command: buildAndPush
dockerfile: '$(Build.SourcesDirectory)/dockerdev/Dockerfile'
tags: |
feewaiver_dev_latest
feewaiver_dev_$(tagDate)
containerRegistry: DockerHub
repository: dbcawa/docker_app_dev