Skip to content

Commit 3ade9ca

Browse files
committed
revamp codedeploy
1 parent 22bdc66 commit 3ade9ca

File tree

1 file changed

+138
-75
lines changed

1 file changed

+138
-75
lines changed

src/content/docs/aws/services/codedeploy.md

Lines changed: 138 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
title: CodeDeploy
3-
linkTitle: CodeDeploy
4-
description: >
5-
Get started with CodeDeploy on LocalStack
3+
description: Get started with CodeDeploy on LocalStack
64
tags: ["Ultimate"]
75
---
86

@@ -13,7 +11,7 @@ On AWS, it supports deployments to Amazon EC2 instances, on-premises instances,
1311
Furthermore, based on the target it is also possible to use an in-place deployment or a blue/green deployment.
1412

1513
LocalStack supports a mocking of CodeDeploy API operations.
16-
The supported operations are listed on the [API coverage page]({{< ref "coverage_codedeploy" >}}).
14+
The supported operations are listed on the [API coverage page]().
1715

1816
## Getting Started
1917

@@ -28,20 +26,27 @@ Start LocalStack using your preferred method.
2826
An application is a CodeDeploy construct that uniquely identifies your targetted application.
2927
Create an application with the [CreateApplication](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateApplication.html) operation:
3028

31-
{{< command >}}
32-
$ awslocal deploy create-application --application-name hello --compute-platform Server
33-
<disable-copy>
29+
```bash
30+
awslocal deploy create-application --application-name hello --compute-platform Server
31+
```
32+
33+
The output will be similar to the following:
34+
35+
```json
3436
{
3537
"applicationId": "063714b6-f438-4b90-bacb-ce04af7f5e83"
3638
}
37-
</disable-copy>
38-
{{< /command >}}
39+
```
3940

4041
Make note of the application name, which can be used with other operations such as [GetApplication](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_GetApplication.html), [UpdateApplication](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_UpdateApplication.html) and [DeleteApplication](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_DeleteApplication.html).
4142

42-
{{< command >}}
43-
$ awslocal deploy get-application --application-name hello
44-
<disable-copy>
43+
```bash
44+
awslocal deploy get-application --application-name hello
45+
```
46+
47+
The output will be similar to the following:
48+
49+
```json
4550
{
4651
"application": {
4752
"applicationId": "063714b6-f438-4b90-bacb-ce04af7f5e83",
@@ -50,57 +55,69 @@ $ awslocal deploy get-application --application-name hello
5055
"computePlatform": "Server"
5156
}
5257
}
53-
</disable-copy>
54-
{{< /command >}}
58+
```
5559

5660
You can list all application using [ListApplications](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_ListApplications.html).
5761

58-
{{< command >}}
59-
$ awslocal deploy list-applications
60-
<disable-copy>
62+
```bash
63+
awslocal deploy list-applications
64+
```
65+
66+
The output will be similar to the following:
67+
68+
```json
6169
{
6270
"applications": [
6371
"hello"
6472
]
6573
}
66-
</disable-copy>
67-
{{< /command >}}
74+
```
6875

6976
### Deployment configuration
7077

7178
A deployment configuration consists of rules for deployment along with success and failure criteria.
7279

7380
Create a deployment configuration using [CreateDeploymentConfig](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeploymentConfig.html):
7481

75-
{{< command >}}
76-
$ awslocal deploy create-deployment-config --deployment-config-name hello-conf \
82+
```bash
83+
awslocal deploy create-deployment-config --deployment-config-name hello-conf \
7784
--compute-platform Server \
7885
--minimum-healthy-hosts '{"type": "HOST_COUNT", "value": 1}'
79-
<disable-copy>
86+
```
87+
88+
The output will be similar to the following:
89+
90+
```json
8091
{
8192
"deploymentConfigId": "0327ce0a-4637-4884-8899-49af7b9423b6"
8293
}
83-
</disable-copy>
84-
{{< /command >}}
94+
```
8595

8696
[ListDeploymentConfigs](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_ListDeploymentConfigs.html) can be used to list all available configs:
8797

88-
{{< command >}}
89-
$ awslocal deploy list-deployment-configs
90-
<disable-copy>
98+
```bash
99+
awslocal deploy list-deployment-configs
100+
```
101+
102+
The output will be similar to the following:
103+
104+
```json
91105
{
92106
"deploymentConfigsList": [
93107
"hello-conf"
94108
]
95109
}
96-
</disable-copy>
97-
{{< /command >}}
110+
```
98111

99112
Use [GetDeploymentConfig](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_GetDeploymentConfig.html) and [DeleteDeploymentConfig](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_DeleteDeploymentConfig.html) to manage deployment configurations.
100113

101-
{{< command >}}
102-
$ awslocal deploy get-deployment-config --deployment-config-name hello-conf
103-
<disable-copy>
114+
```bash
115+
awslocal deploy get-deployment-config --deployment-config-name hello-conf
116+
```
117+
118+
The output will be similar to the following:
119+
120+
```json
104121
{
105122
"deploymentConfigInfo": {
106123
"deploymentConfigId": "0327ce0a-4637-4884-8899-49af7b9423b6",
@@ -113,40 +130,61 @@ $ awslocal deploy get-deployment-config --deployment-config-name hello-conf
113130
"computePlatform": "Server"
114131
}
115132
}
116-
</disable-copy>
117-
{{< /command >}}
133+
```
118134

119135
### Deployment groups
120136

121-
Deployment groups can be managed with [CreateDeploymentGroup](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeploymentGroup.html), [ListDeploymentGroups](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_ListDeploymentGroups.html), [UpdateDeploymentGroup](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_UpdateDeploymentGroup.html), [GetDeploymentGroup](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_GetDeploymentGroup.html) and [DeleteDeploymentGroup](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_DeleteDeploymentGroup.html).
137+
Deployment groups can be managed with:
138+
139+
- [CreateDeploymentGroup](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeploymentGroup.html)
140+
- [ListDeploymentGroups](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_ListDeploymentGroups.html)
141+
- [UpdateDeploymentGroup](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_UpdateDeploymentGroup.html)
142+
- [GetDeploymentGroup](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_GetDeploymentGroup.html)
143+
- [DeleteDeploymentGroup](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_DeleteDeploymentGroup.html)
144+
145+
Create a deployment group with [CreateDeploymentGroup](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeploymentGroup.html):
122146

123-
{{< command >}}
124-
$ awslocal deploy create-deployment-group \
147+
```bash
148+
awslocal deploy create-deployment-group \
125149
--application-name hello \
126150
--service-role-arn arn:aws:iam::000000000000:role/role \
127151
--deployment-group-name hello-group
128-
<disable-copy>
152+
```
153+
154+
The output will be similar to the following:
155+
156+
```json
129157
{
130158
"deploymentGroupId": "09506586-9ba9-4005-a1be-840407abb39d"
131159
}
132-
</disable-copy>
133-
{{< /command >}}
160+
```
161+
162+
List all deployment groups for an application with [ListDeploymentGroups](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_ListDeploymentGroups.html):
163+
164+
```bash
165+
awslocal deploy list-deployment-groups --application-name hello
166+
```
134167

135-
{{< command >}}
136-
$ awslocal deploy list-deployment-groups --application-name hello
137-
<disable-copy>
168+
The output will be similar to the following:
169+
170+
```json
138171
{
139172
"deploymentGroups": [
140173
"hello-group"
141174
]
142175
}
143-
</disable-copy>
144-
{{< /command >}}
176+
```
177+
178+
Get a deployment group with [GetDeploymentGroup](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_GetDeploymentGroup.html):
145179

146-
{{< command >}}
147-
$ awslocal deploy get-deployment-group --application-name hello \
180+
```bash
181+
awslocal deploy get-deployment-group --application-name hello \
148182
--deployment-group-name hello-group
149-
<disable-copy>
183+
```
184+
185+
The output will be similar to the following:
186+
187+
```json
150188
{
151189
"deploymentGroupInfo": {
152190
"applicationName": "hello",
@@ -165,39 +203,58 @@ $ awslocal deploy get-deployment-group --application-name hello \
165203
"terminationHookEnabled": false
166204
}
167205
}
168-
</disable-copy>
169-
{{< /command >}}
206+
```
170207

171208
### Deployments
172209

173-
Operations related to deployment management are: [CreateDeployment](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeployment.html), [GetDeployment](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_GetDeployment.html), [ListDeployments](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_ListDeployments.html).
210+
Operations related to deployment management are:
211+
212+
- [CreateDeployment](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeployment.html)
213+
- [GetDeployment](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_GetDeployment.html)
214+
- [ListDeployments](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_ListDeployments.html)
174215

175-
{{< command >}}
176-
$ awslocal deploy create-deployment \
216+
Create a deployment with [CreateDeployment](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeployment.html):
217+
218+
```bash
219+
awslocal deploy create-deployment \
177220
--application-name hello \
178221
--deployment-group-name hello-group \
179222
--revision '{"revisionType": "S3", "s3Location": {"bucket": "placeholder", "key": "placeholder", "bundleType": "tar"}}'
180-
<disable-copy>
223+
```
224+
225+
The output will be similar to the following:
226+
227+
```json
181228
{
182229
"deploymentId": "d-TU3TNCSTO"
183230
}
184-
</disable-copy>
185-
{{< /command >}}
231+
```
232+
233+
List all deployments for an application with [ListDeployments](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_ListDeployments.html):
186234

187-
{{< command >}}
188-
$ awslocal deploy list-deployments
189-
<disable-copy>
235+
```bash
236+
awslocal deploy list-deployments
237+
```
238+
239+
The output will be similar to the following:
240+
241+
```json
190242
{
191243
"deployments": [
192244
"d-TU3TNCSTO"
193245
]
194246
}
195-
</disable-copy>
196-
{{< /command >}}
247+
```
248+
249+
Get a deployment with [GetDeployment](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_GetDeployment.html):
250+
251+
```bash
252+
awslocal deploy get-deployment --deployment-id d-TU3TNCSTO
253+
```
254+
255+
The output will be similar to the following:
197256

198-
{{< command >}}
199-
$ awslocal deploy get-deployment --deployment-id d-TU3TNCSTO
200-
<disable-copy>
257+
```json
201258
{
202259
"deploymentInfo": {
203260
"applicationName": "hello",
@@ -227,24 +284,30 @@ $ awslocal deploy get-deployment --deployment-id d-TU3TNCSTO
227284
"computePlatform": "Server"
228285
}
229286
}
230-
</disable-copy>
231-
{{< /command >}}
287+
```
288+
289+
Furthermore, [ContinueDeployment](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_StopDeployment.html) and [StopDeployment](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_StopDeployment.html) can be used to control the deployment flows:
290+
291+
Continue a deployment with [ContinueDeployment](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_StopDeployment.html):
292+
293+
```bash
294+
awslocal deploy continue-deployment --deployment-id d-TU3TNCSTO
295+
```
296+
297+
Stop a deployment with [StopDeployment](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_StopDeployment.html):
232298

233-
Furthermore, [ContinueDeployment](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_StopDeployment.html) and [StopDeployment](https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_StopDeployment.html) can be used to control the deployment flows.
299+
```bash
300+
awslocal deploy stop-deployment --deployment-id d-TU3TNCSTO
301+
```
234302

235-
{{< command >}}
236-
$ awslocal deploy continue-deployment --deployment-id d-TU3TNCSTO
237-
{{< /command >}}
303+
The output will be similar to the following:
238304

239-
{{< command >}}
240-
$ awslocal deploy stop-deployment --deployment-id d-TU3TNCSTO
241-
<disable-copy>
305+
```json
242306
{
243307
"status": "Succeeded",
244308
"statusMessage": "Mock deployment stopped"
245309
}
246-
</disable-copy>
247-
{{< /command >}}
310+
```
248311

249312
## Limitations
250313

0 commit comments

Comments
 (0)