-
Notifications
You must be signed in to change notification settings - Fork 4
/
portal-lara-pipeline.yml
129 lines (126 loc) · 4.63 KB
/
portal-lara-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
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
AWSTemplateFormatVersion: '2010-09-09'
Description: Portal or LARA Code Pipeline
Parameters:
PipelineName:
Type: String
Description: This will be used for the name of the pipeline, it typically should be the
domain name that is being managed by the pipeline.
RepoName:
Type: String
AllowedValues: [rigse, lara]
Description: This will be appended to 'concord-consortium/' to make the full repository name
and if it is lara then the report service won't be configured. This will also be used
for the CodeBuild project name
AppServiceName:
Type: String
Description: The name of the ECS service for the App that the pipeline will update
WorkerServiceName:
Type: String
Description: The name of the ECS service for the Worker that the pipeline will update
ReportServiceName:
Type: String
Description: The name of the ECS service for the Report that the pipeline will update
BranchName:
Type: String
Description: The name of the github branch to automatically deploy
Conditions:
HasReportService: !Equals [!Ref RepoName, "rigse"]
Resources:
AppPipeline:
Type: 'AWS::CodePipeline::Pipeline'
Properties:
Name: !Ref PipelineName
RoleArn: arn:aws:iam::816253370536:role/service-role/AWSCodePipelineServiceRole-us-east-1-learn-qa
Stages:
- Name: Source
Actions:
- Name: Source
ActionTypeId:
Category: Source
Owner: AWS
Version: 1
Provider: CodeStarSourceConnection
OutputArtifacts:
- Name: SourceArtifact
Configuration:
ConnectionArn: arn:aws:codestar-connections:us-east-1:816253370536:connection/73546caa-70a8-4125-88a1-edc428c32ad1
BranchName: !Ref BranchName
FullRepositoryId: !Sub concord-consortium/${RepoName}
DetectChanges: true
- Name: Build
Actions:
- Name: Build
ActionTypeId:
Category: Build
Owner: AWS
Version: 1
Provider: CodeBuild
OutputArtifacts:
- Name: BuildArtifact
InputArtifacts:
- Name: SourceArtifact
Configuration:
ProjectName: !Ref RepoName
EnvironmentVariables: !Sub |
[{ "name": "BRANCH_NAME",
"value": "${BranchName}",
"type": "PLAINTEXT"
}]
- Name: Deploy
Actions:
- Name: UpdateAppService
ActionTypeId:
Category: Deploy
Owner: AWS
Version: 1
Provider: ECS
InputArtifacts:
- Name: BuildArtifact
Configuration:
ClusterName: qa
ServiceName: !Ref AppServiceName
FileName: app-imagedefinitions.json
- Name: UpdateWorkerService
ActionTypeId:
Category: Deploy
Owner: AWS
Version: 1
Provider: ECS
InputArtifacts:
- Name: BuildArtifact
Configuration:
ClusterName: qa
ServiceName: !Ref WorkerServiceName
FileName: worker-imagedefinitions.json
- !If
- HasReportService
- Name: UpdateReportService
ActionTypeId:
Category: Deploy
Owner: AWS
Version: 1
Provider: ECS
InputArtifacts:
- Name: BuildArtifact
Configuration:
ClusterName: qa
ServiceName: !Ref ReportServiceName
FileName: report-imagedefinitions.json
- !Ref 'AWS::NoValue'
ArtifactStore:
Type: S3
Location: codepipeline-us-east-1-41654313229
AppNotificationRule:
Type: AWS::CodeStarNotifications::NotificationRule
Properties:
DetailType: FULL
EventTypeIds:
- codepipeline-pipeline-pipeline-execution-failed
- codepipeline-pipeline-pipeline-execution-succeeded
Name: Slack
Resource: !Sub arn:aws:codepipeline:${AWS::Region}:${AWS::AccountId}:${AppPipeline}
# even though the name of this configuration is portal-lara-dev it actually
# sends messages to the portal-lara-deploys channel
Targets:
- TargetAddress: arn:aws:chatbot::816253370536:chat-configuration/slack-channel/portal-lara-dev
TargetType: AWSChatbotSlack