You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/modules/deploy/pages/configure-deploy-markers.adoc
+18-10Lines changed: 18 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,17 @@ Deploy markers provide a lightweight way to log your deployments without requiri
11
11
12
12
For a full guide to CircleCI's deploys features and functionality, refer to the xref:deployment-overview.adoc[Deployment and deploy management] guide.
13
13
14
+
You can configure deploy markers as follows:
15
+
16
+
* To display updated statuses depending of the outcome of your deployments. Steps for this are provided in the <<deploy-markers-with-status-updates>> section.
17
+
* Or, you can choose to configure deploy markers to log deployments without status updates. Steps for this are provided in the <<deploy-logs-without-status-updates>> section.
18
+
14
19
== Prerequisites
15
20
16
21
* A CircleCI account connected to your code. You can link:https://circleci.com/signup/[sign up for free].
17
22
* A CircleCI project with a workflow configured to deploy your code.
18
23
19
-
== 1. Update the configuration
24
+
== Deploy markers with status updates
20
25
21
26
To create a deployment marker, you will update your CircleCI configuration file.
22
27
@@ -102,6 +107,7 @@ jobs:
102
107
=== 1.3. Update the deploy status to success or failure
103
108
You can use the `when` attribute to add `on_success` and `on_failure` steps at the end of your deployment job, to handle the final status update of the deploy.
104
109
110
+
.Config file example showing deploy status update to success or failure
105
111
[,yml]
106
112
----
107
113
jobs:
@@ -129,21 +135,23 @@ jobs:
129
135
when: on_fail
130
136
----
131
137
132
-
This will update the status of the deploy to `SUCCESS` or `FAILED` depending on the outcome of your job.
133
-
In this example, the `failure_reason.env` file can be created by a previous step in the job. This can be done, for example, in a step in which we are validating the status of the deployment.
134
-
You can do that as shown below:
138
+
In this example, the status of the deploy is updated to `SUCCESS` or `FAILED` depending on the outcome of your job.
139
+
140
+
The `failure_reason.env` file can be created by a previous step in the job. This can be done, for example, in a step in which we are validating the status of the deployment. One way to do this is as follows:
135
141
142
+
.Create a file to store the failure reason
136
143
[,yml]
137
144
----
138
145
echo "FAILURE_REASON='Deployment was not found'" > failure_reason.env
139
146
----
140
147
141
148
CAUTION: Trying to update the status of the deploy after updating it to a terminal status such as `SUCCESS`, `FAILED` or `CANCELED` is not supported and will result in an error.
142
149
143
-
=== 1.3 Update the deploy status to canceled
150
+
=== 1.4 Update the deploy status to canceled
144
151
145
152
If you want to update your deployment to `canceled` when the deploy job is canceled, you can do so by adding the following job to your configuration.
146
153
154
+
.Job configuration for updating the deploy status to canceled
147
155
[,yml]
148
156
----
149
157
jobs:
@@ -163,6 +171,7 @@ jobs:
163
171
164
172
Then you can add it to your workflow as shown below.
165
173
174
+
.Workflow configuration for updating the deploy status to canceled. The cancel-deploy job only runs when the deploy job is canceled
166
175
[,yml]
167
176
----
168
177
workflows:
@@ -175,9 +184,9 @@ workflows:
175
184
- canceled
176
185
----
177
186
178
-
This will make it sot that the job will be run only when the `deploy` job is canceled, thus updating the deployment to the `canceled` status.
187
+
In this example, the `cancel-deploy` job will be run only when the `deploy` job is canceled, thus updating the deployment to the `canceled` status.
179
188
180
-
=== 2.4. Full config example
189
+
=== 1.5. Full config example
181
190
182
191
For reference, here is a full example of a CircleCI config that makes use of the deployment tracking feature.
183
192
@@ -236,7 +245,7 @@ workflows:
236
245
- canceled
237
246
----
238
247
239
-
== 3. Deploy logs
248
+
== Deploy logs without status updates
240
249
241
250
Sometimes you might not want your deployment marker to have any specific status, but still want it to be logged in the deploys UI.
242
251
In those cases you can use the `release log` command in place of `release plan` as shown in the example below.
@@ -312,5 +321,4 @@ By following the steps in this guide, you have added a deploy marker to your Cir
312
321
You can now track the status of your deployments across your configured environments in the CircleCI deploys UI and in the project home page.
313
322
You can now:
314
323
315
-
* xref:set-up-the-release-agent.adoc[Set up a release agent on your Kubernetes cluster].
316
-
* xref:configure-deploy-markers.adoc[Learn about deploy markers]
0 commit comments