This repository has been archived by the owner on Apr 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipelines-docker.yml
61 lines (58 loc) · 1.71 KB
/
azure-pipelines-docker.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: $(GitVersion.SemVer)
trigger:
- master
resources:
- repo: self
stages:
- stage: Build
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: 'ubuntu-latest'
steps:
- task: gitversion/setup@0
displayName: Setup GitVersion
inputs:
versionSpec: '5.x'
- task: gitversion/execute@0
displayName: Determine Version
- task: Docker@2
displayName: Login to Dockerhub
inputs:
command: login
containerRegistry: Dockerhub
- task: Docker@2
displayName: Build the image
inputs:
command: build
dockerfile: '$(Build.SourcesDirectory)/NewsletterCurator.Web/Dockerfile'
repository: 'cdemi/NewsletterCurator'
buildContext: '$(Build.SourcesDirectory)'
arguments: --build-arg VERSION=$(GitVersion.AssemblySemVer)
tags: |
latest
$(GitVersion.SemVer)
$(GitVersion.SemVer)-linux
latest-linux
- task: Docker@2
displayName: Push a latest image
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
command: push
repository: 'cdemi/NewsletterCurator'
tags: |
latest
$(GitVersion.SemVer)
$(GitVersion.SemVer)-linux
latest-linux
- task: Docker@2
displayName: Push an image
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
command: push
repository: 'cdemi/NewsletterCurator'
tags: |
$(GitVersion.SemVer)
$(GitVersion.SemVer)-linux