-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-pipeline.yml
62 lines (55 loc) · 1.7 KB
/
docker-pipeline.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
62
pool:
name: Hosted Ubuntu 1604
steps:
- bash: |
shopt -s nullglob
function join_by { local IFS="$1"; shift; echo "$*"; }
lib_path=$(join_by ';' $(Agent.WorkFolder)/_tasks/GitVersion*/4.0.*/lib/linux/x86_64)
echo LD_LIBRARY_PATH: $lib_path
echo "##vso[task.setvariable variable=LD_LIBRARY_PATH]$lib_path"
displayName: Update LD_LIBRARY_PATH for GitVersion
- task: GitVersion@4
displayName: 'GitVersion'
inputs:
updateAssemblyInfo: true
- task: Docker@2
displayName: Login to Docker Hub
inputs:
containerRegistry: docker
command: login
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: Docker@2
displayName: 'Build Synker Api image'
inputs:
containerRegistry: docker
command: build
buildContext: '$(Build.SourcesDirectory)'
repository: 'synker/synker_api'
tags: |
$(GitVersion.SemVer)
latest
- task: Docker@2
displayName: 'Push Synker image'
inputs:
containerRegistry: docker
command: push
repository: 'synker/synker_api'
tags: |
$(GitVersion.SemVer)
latest
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: Docker@2
displayName: Logout of Docker Hub
inputs:
command: logout
containerRegistry: docker
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
- task: GitHubRelease@0
inputs:
gitHubConnection: 'GitHub'
action: 'create'
tagSource: 'manual'
tag: 'v$(GitVersion.SemVer)'
title: 'v$(GitVersion.SemVer)'
isPreRelease: contains(variables['GitVersion.SemVer'], '-')
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))