forked from oliviabarrick/fluxcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines-docker.yml
More file actions
52 lines (47 loc) · 1.17 KB
/
azure-pipelines-docker.yml
File metadata and controls
52 lines (47 loc) · 1.17 KB
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
name: 'Fluxcloud Container Build'
trigger:
- "master"
pr: none
pool:
vmImage: 'ubuntu-latest'
variables:
repositoryName: "procter-gamble/fluxcloud"
major: '1'
minor: '00'
patchNumber: $[counter(format('{0}.{1}', variables['major'], variables['minor']), 0)]
buildTag: 'v$(major).$(minor).$(patchNumber)'
steps:
- task: GoTool@0
displayName: 'Download Go'
inputs:
version: '1.15.2'
- task: Go@0
displayName: 'Build'
inputs:
command: 'build'
workingDirectory: '$(System.DefaultWorkingDirectory)'
arguments: "-o fluxcloud ./cmd/"
- task: Go@0
displayName: 'Test'
inputs:
command: 'test'
arguments: '-v ./pkg/...'
workingDirectory: '$(System.DefaultWorkingDirectory)'
- task: Docker@2
displayName: 'Build and Push Container'
inputs:
containerRegistry: pgshared02
repository: $(repositoryName)
command: 'buildAndPush'
Dockerfile: './Dockerfile'
tags: |
$(buildTag)
- task: Docker@2
displayName: 'Push Container To Shared GCR'
inputs:
containerRegistry: shared-gcr
repository: 'shared-gcr-c99a/$(repositoryName)'
command: 'buildAndPush'
Dockerfile: './Dockerfile'
tags: |
$(buildTag)