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
/
Copy pathazure-pipelines.yml
132 lines (105 loc) · 3.94 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# 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/*
- bugfix/*
variables:
application.name: 'tt-data-capture'
azure.subscription.endpoint: 'hmcts-pet'
manual.branch.prefix: 'master'
resources:
containers:
- container: postgres
image: postgres:9.6
env: { POSTGRES_HOST_AUTH_METHOD: trust }
ports:
- 5432:5432
jobs:
- job: TestApplication
pool:
vmImage: 'Ubuntu-20.04'
services:
postgres: postgres
variables:
rubyVersion: '= 3.1.4'
bundlerVersion: '2.2.28'
env: 'test'
external_url: 'test'
govuk_notify_api_key: 'test'
moj_file_uploader_endpoint: 'http://127.0.0.1:9292'
payement_endpoint: 'http://localhost:4500'
fees_external_url: 'http://localhost:3003/case_requests'
tax_tribunals_downloader_url: 'http://localhost:9393'
aptDependencies: 'postgresql-client shared-mime-info'
nocoverage: true
address_lookup_endpoint: 'https://api.os.uk'
BUNDLE_PATH: $(Pipeline.Workspace)/.bundle
notify_case_confirmation_template_id: 'confirmation'
notify_ftt_case_notification_template_id: 'fft_confirmation'
notify_case_first_reminder_template_id: 'first'
notify_case_last_reminder_template_id: 'last'
notify_new_case_saved_template_id: 'case_saved'
notify_reset_password_template_id: 'reset'
notify_change_password_template_id: 'change'
notify_send_application_detail_template_id: 'application_details'
notify_case_confirmation_cy_template_id: 'confirmation'
notify_ftt_case_notification_cy_template_id: 'fft_confirmation'
notify_case_first_reminder_cy_template_id: 'first'
notify_case_last_reminder_cy_template_id: 'last'
notify_new_case_saved_cy_template_id: 'case_saved'
notify_reset_password_cy_template_id: 'reset'
notify_change_password_cy_template_id: 'change'
notify_send_application_detail_cy_template_id: 'application_details'
steps:
- template: ./pipeline-steps/add-dependencies.yaml
- 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:
vmImage: 'Ubuntu-20.04'
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:
vmImage: 'Ubuntu-20.04'
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:
vmImage: 'Ubuntu-20.04'
steps:
- template: ./pipeline-steps/docker-build-manual.yaml
parameters:
azureContainerRegistry: $(azure.container.registry)
azureSubscriptionEndpoint: $(azure.subscription.endpoint)
manualBranchPrefix: $(manual.branch.prefix)
applicationName: $(application.name)