-
Notifications
You must be signed in to change notification settings - Fork 35
/
svn-on-ecs.yml
284 lines (284 loc) · 7.68 KB
/
svn-on-ecs.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 部署SVN环境。
en: Deploy the SVN environment.
Parameters:
InstanceSource:
Type: String
Default: CreateNew
Label:
zh-cn: 实例来源
en: Instance Source
AllowedValues:
- CreateNew
- UseExisted
AssociationPropertyMetadata:
ValueLabelMapping:
CreateNew:
zh-cn: 创建新实例
en: Create New Instance
UseExisted:
zh-cn: 选择已有实例
en: Select Existed Instance
ZoneId:
Type: String
Default: null
Required: true
Label:
en: Availability Zone
zh-cn: 可用区
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
AssociationPropertyMetadata:
AutoSelectFirst: true
Visible:
Condition:
Fn::Equals:
- ${InstanceSource}
- CreateNew
ImageId:
Type: String
Default: aliyun_3_x64_20G_alibase_20240528.vhd
Required: true
Label:
en: Image of Instance
zh-cn: 实例镜像
AllowedValues:
- aliyun_3_x64_20G_alibase_20240528.vhd
AssociationPropertyMetadata:
ValueLabelMapping:
aliyun_3_x64_20G_alibase_20240528.vhd:
zh-cn: Alibaba Cloud Linux 3
en: Alibaba Cloud Linux 3
Visible:
Condition:
Fn::Equals:
- ${InstanceSource}
- CreateNew
InstanceType:
Type: String
Default: null
Required: true
Label:
en: Instance Type
zh-cn: 实例类型
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ${ZoneId}
SpotStrategy: SpotAsPriceGo
InstanceChargeType: PostPaid
SystemDiskCategory: cloud_essd
Visible:
Condition:
Fn::Equals:
- ${InstanceSource}
- CreateNew
InstancePassword:
Type: String
NoEcho: true
Default: null
Confirm: true
Description:
en: >-
Server login password, Length 8-30, must contain three(Capital letters,
lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special
symbol in)
zh-cn: >-
服务器登录密码,长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/
中的特殊符号)
Label:
en: Instance Password
zh-cn: 实例密码
ConstraintDescription:
en: >-
Length 8-30, must contain three(Capital letters, lowercase letters,
numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)
zh-cn: '长度8-30,必须包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;''<>,.?/ 中的特殊符号)'
AssociationProperty: 'ALIYUN::ECS::Instance::Password'
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Equals:
- ${InstanceSource}
- CreateNew
EcsInstanceId:
Type: String
Default: null
Label:
en: ECS Instance ID
zh-cn: ECS实例ID
Description:
zh-cn: 创建ECS实例时,ECS实例ID。<br><b>注: <font color='blue'>该一键部署脚本仅支持Alibaba Cloud Linux 3,请勿选择其他操作系统的实例。</font></b>
en: ECS instance ID,<br><b>note: <font color='blue'>This one click deployment script only supports Alibaba Cloud Linux 3, please do not select instances of other operating systems</font></b>
AssociationProperty: ALIYUN::ECS::Instance::InstanceId
AssociationPropertyMetadata:
Status: Running
Visible:
Condition:
Fn::Equals:
- ${InstanceSource}
- UseExisted
CommonName:
Type: String
Default: deploy_svn_by_ros
Conditions:
CreateInstance:
Fn::Equals:
- Ref: InstanceSource
- CreateNew
UseExistedInstance:
Fn::Equals:
- Ref: InstanceSource
- UseExisted
Resources:
Vpc:
Type: 'ALIYUN::ECS::VPC'
Condition: CreateInstance
Properties:
CidrBlock: 192.168.0.0/16
VpcName:
Fn::Sub: ${CommonName}-vpc
VSwitch:
Type: 'ALIYUN::ECS::VSwitch'
Condition: CreateInstance
Properties:
VpcId:
Ref: Vpc
CidrBlock: 192.168.0.0/24
ZoneId:
Ref: ZoneId
VSwitchName:
Fn::Sub: ${CommonName}-vsw
SecurityGroup:
Type: 'ALIYUN::ECS::SecurityGroup'
Condition: CreateInstance
Properties:
VpcId:
Ref: Vpc
SecurityGroupName:
Fn::Sub: ${CommonName}-sg
SecurityGroupIngress:
- PortRange: 22/22
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
- PortRange: 3690/3690
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
- PortRange: '-1/-1'
SourceCidrIp: 0.0.0.0/0
IpProtocol: icmp
EcsInstance:
Type: 'ALIYUN::ECS::InstanceGroup'
Condition: CreateInstance
Properties:
VpcId:
Ref: Vpc
ZoneId:
Ref: ZoneId
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId:
Ref: ImageId
InstanceName:
Fn::Sub: ${CommonName}-ecs
InstanceType:
Ref: InstanceType
SystemDiskCategory: cloud_essd
MaxAmount: 1
InternetMaxBandwidthOut: 100
SpotStrategy: SpotAsPriceGo
Password:
Ref: InstancePassword
ModuleInstallSVN:
Version: default
Type: 'MODULE::ACS::OOS::Extension'
Properties:
EcsInstanceIds:
- Fn::If:
- UseExistedInstance
- Ref: EcsInstanceId
- Ref: EcsInstance
PackageName: ACS-Extension-svn-1853370294850618
DsEcs:
Type: 'DATASOURCE::ECS::Instances'
Properties:
InstanceIds:
- Fn::If:
- UseExistedInstance
- Ref: EcsInstanceId
- Ref: EcsInstance
SecurityGroupIngress_22:
Type: ALIYUN::ECS::SecurityGroupIngress
Condition: UseExistedInstance
Properties:
SecurityGroupId:
Fn::Jq:
- First
- .[0].SecurityGroupIds[0]
- Fn::GetAtt:
- DsEcs
- Instances
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: intranet
PortRange: 22/22
SecurityGroupIngress_3690:
Type: ALIYUN::ECS::SecurityGroupIngress
Condition: UseExistedInstance
Properties:
SecurityGroupId:
Fn::Jq:
- First
- .[0].SecurityGroupIds[0]
- Fn::GetAtt:
- DsEcs
- Instances
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: intranet
PortRange: 3690/3690
Outputs:
EcsLoginAddress:
Description:
en: Ecs login address.
zh-cn: ECS登录地址。
Value:
Fn::Sub:
- https://ecs-workbench.aliyun.com/?from=EcsConsole&instanceType=ecs®ionId=${ALIYUN::Region}&instanceId=${InstanceId}
- InstanceId:
Fn::If:
- UseExistedInstance
- Ref: EcsInstanceId
- Ref: EcsInstance
Console@Url:
Label:
en: URL of repository.
zh-cn: 仓库访问地址。
Description:
en: URL of repository.
zh-cn: 仓库访问地址。
Value:
Fn::Sub:
- http://${PublicIp}
- PublicIp:
Fn::Jq:
- First
- if .[0].PublicIpAddress != [] then .[0].PublicIpAddress[0] else .[0].EipAddress.IpAddress end
- Fn::GetAtt:
- DsEcs
- Instances
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- InstanceSource
- ZoneId
- ImageId
- InstanceType
- InstancePassword
- EcsInstanceId
Hidden:
- CommonName
TemplateTags:
- acs:document-help:ecs:部署SVN环境