This repository has been archived by the owner on Sep 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
azure-pipelines.yml
101 lines (77 loc) · 2.45 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Ruby
# Package your Ruby project.
# Add steps that install rails, analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/ruby
name: '$(SourceBranchName)-$(Build.SourceVersion) Build-$(Build.BuildId)'
trigger:
batch: true
branches:
include:
- master
tags:
include:
- v*
pr:
autoCancel: true
branches:
include:
- master
- feature/*
variables:
application.name: 'tt-data-capture'
azure.subscription.endpoint: 'hmcts-pet'
manual.branch.prefix: 'master'
resources:
containers:
# - container: my_container
# image: ubuntu:16.04
- container: postgres
image: postgres:9.6
ports:
- 5432:5432
jobs:
- job: TestApplication
pool:
vmImage: 'Ubuntu-16.04'
services:
postgres: postgres
variables:
rubyVersion: '= 2.5.5'
bundlerVersion: '1.17.3'
steps:
# - template: ./pipeline-steps/test-application.yaml
- template: ./pipeline-steps/publish-tests.yaml
- job: BuildAndPushImageCI
dependsOn: TestApplication
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), not(startsWith(variables['Build.SourceBranch'], 'refs/tags/')), ne(variables['Build.Reason'], 'Manual'))
pool:
name: hmcts-pet
steps:
- template: ./pipeline-steps/docker-build.yaml
parameters:
azureContainerRegistry: $(azure.container.registry)
azureSubscriptionEndpoint: $(azure.subscription.endpoint)
applicationName: $(application.name)
- job: BuildAndPushImageRelease
dependsOn: TestApplication
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
pool:
name: hmcts-pet
steps:
- template: ./pipeline-steps/docker-build-release.yaml
parameters:
azureContainerRegistry: $(azure.container.registry)
azureSubscriptionEndpoint: $(azure.subscription.endpoint)
applicationName: $(application.name)
- job: BuildAndPushImageManual
dependsOn: TestApplication
condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual'))
pool:
name: hmcts-pet
steps:
- template: ./pipeline-steps/docker-build-manual.yaml
parameters:
azureContainerRegistry: $(azure.container.registry)
azureSubscriptionEndpoint: $(azure.subscription.endpoint)
manualBranchPrefix: $(manual.branch.prefix)
applicationName: $(application.name)