-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yaml
39 lines (35 loc) · 1.06 KB
/
azure-pipelines.yaml
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
trigger:
tags:
include:
- "*.*.*"
variables:
vmImage: "ubuntu-16.04"
repository: "survivorbat/nginx-jinja2"
# The tag will be the version
nginx_base_version: $(Build.SourceBranchName)
stages:
- stage: BuildAndPublish
displayName: Build and publish Image
jobs:
- job: BuildAndPublish
displayName: Build and Publish image
pool:
vmImage: $(vmImage)
steps:
- task: Docker@2
displayName: Build nginx image
inputs:
command: build
repository: $(repository)
arguments: --build-arg nginx_base_version=$(nginx_base_version)
tags: |
$(nginx_base_version)
- task: Docker@2
displayName: Publish nginx image
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
inputs:
containerRegistry: 'DockerHub'
command: push
repository: $(repository)
tags: |
$(nginx_base_version)