-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
57 lines (53 loc) · 1.21 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
48
49
50
51
52
53
54
55
56
57
resources:
- repo: self
pr:
branches:
include:
- master
- release/v*
trigger:
batch: true
branches:
include:
- release/v*
- refs/relelase/v*
- master
- feature/*
- topic/*
- develop
- hotfix/*
- refs/tags/v*
jobs:
- job: docker_ci
displayName: "CI"
pool:
vmImage: 'ubuntu-latest'
timeoutInMinutes: 90
variables:
isPullRequest: $[ eq(variables['Build.Reason'], 'PullRequest') ]
imageName: rate-it/sentiment
image: ./src/Sentiment.Api/Dockerfile
imageTag: $(Build.SourceBranchName)
steps:
- task: Docker@2
inputs:
containerRegistry: 'DockerHub'
repository: $(imageName)
command: 'build'
buildContext: '.'
Dockerfile: $(image)
tags: |
$(Build.SourceBranchName)
- task: Docker@2
condition: and(succeeded(), ne(variables['isPullRequest'],True))
inputs:
containerRegistry: 'DockerHub'
command: 'login'
- task: Docker@2
condition: and(succeeded(), ne(variables['isPullRequest'],True))
inputs:
containerRegistry: 'DockerHub'
repository: $(imageName)
command: 'push'
tags: |
$(Build.SourceBranchName)