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
+44-53Lines changed: 44 additions & 53 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,83 +16,58 @@ For a full guide to CircleCI's deploys features and functionality, refer to the
16
16
* A CircleCI account connected to your code. You can link:https://circleci.com/signup/[sign up for free].
17
17
* A CircleCI project with a workflow configured to deploy your code.
18
18
19
-
== 1. Create an envrionment
20
-
21
-
Our first step is to create an environment and component for your deployment. You can choose to skip this step if either of the following is true:
22
-
23
-
* You already have an environment set up in your organization.
24
-
* You are happy for CircleCI to automatically create an environment with the name `default` and a component with the name of your project.
25
-
26
-
=== 1.1 Create an environment integration
27
-
28
-
. In the link:https://app.circleci.com[CircleCI web app], select your org from the org cards on your user homepage.
29
-
. Select **Deploys** in the sidebar.
30
-
. Select the **Environments** tab.
31
-
. Select btn:[Create Environment Integration].
32
-
. Enter a name for your environment, and a description if you would like.
33
-
. Use the dropdown menu to choose your environment integration type. Choose the "Custom" option to follow along with this guide,. If you are deploying to your Kubernetes cluster you can or if you want to use the CircleCI release agent, then choose "Kubernetes Cluster" and head over to the xref:set-up-circleci-deploys.adoc[Release agent setup] page.
34
-
. Select btn:[Save and Continue].
35
-
36
-
=== 1.2
37
-
38
-
== 2. Update the configuration
19
+
== 1. Update the configuration
39
20
40
21
To create a deployment marker, you will update your CircleCI configuration file.
22
+
41
23
You will add commands to plan a deploy and then update its status based on the outcome of your deployment script.
42
24
43
-
=== 2.1. Plan a deploy
25
+
=== 1.1. Plan a deploy
44
26
45
27
Add a `circleci run release plan` command to your deployment job. This tells CircleCI to plan a new deploy and show it in the link:https://app.circleci.com/deploys[Deploys UI] with `pending` status.
46
28
47
-
The `target-version` parameter should match the version being deployed.
48
-
49
29
[,yml]
50
30
----
51
31
jobs:
52
32
deploy-my-service:
53
33
executor: some-executor
54
34
steps:
55
-
- run: circleci run release plan --target-version=<some-version-name>
35
+
- run: circleci run release plan <deploy-name> --environment-name=<some-environment-name> --component-name=<some-component-name> --target-version=<some-version-name> --namespace=<some-namespace>
56
36
----
57
37
58
-
If you do not have an environment set up in your organization a new one will be created with the name `default`. This will be set as the target for this deploy. See <<manage-environments>> for more information.
38
+
In this example, note the following flags and options:
39
+
40
+
* The `deploy-name` parameter is used to identify the deployment. `deploy-name` is an arbitrary positional argument that will be used to identify the deployment and should be unique within the workflow. If not specified, the deployment name will be set to `default`. If you are deploying multiple components or to multiple environments from a single workflow, you need to provide the command with a deployment name.
41
+
* The `environment-name` parameter sets the target environment. If the specified environment does not exist, it will be created. If you do not specify an environment, CircleCI will create one named `default`.
42
+
* The `component-name` parameter sets the name that will be displayed in the Deploys UI. If you do not already have a component in your project a new one will be created with the name of the project. This will be set as the component that is being deployed.
43
+
* The `target-version` parameter should match the version being deployed. Some examples are provided <<examples-for-target-version,in the next section>>.
44
+
* The `namespace` parameter is optional and can be provided to use a value other than `default`.
59
45
60
-
If you do not already have a component in your project a new one will be created with the name of the project. This will be set as the component that is being deployed.
46
+
Configuring `circleci run release plan` identifies the deployment you are planning so that you can reference it to update its status later on.
61
47
62
-
If you already have multiple environments and components you must specify their names manually, as follows:
48
+
==== Examples for target-version
63
49
50
+
This section provides some options for setting the `target-version` parameter.
51
+
52
+
* One option is to use CircleCI's built-in environment variables. For example you could define the target version as follows:
53
+
+
64
54
[,yml]
65
55
----
66
-
jobs:
67
-
deploy-my-service:
68
-
executor: some-executor
69
-
steps:
70
-
- run: circleci run release plan <deploy-name> --environment-name=<some-environment-name> --component-name=<some-component-name> --target-version=<some-version-name> --namespace=<some-namespace>
This configuraiton would yield a value with the following format `1.0.28853-ffdbeb1`.
72
60
73
-
In this example, note the following:
74
-
75
-
** The `environment-name` parameter sets the target environment. If the specified environment does not exist, it will be created and named `default`.
76
-
** The `component-name` parameter sets the name that will be displayed in the Deploys UI.
77
-
** The `namespace` parameter is optional and can be provided to use a value other than `default`.
78
-
79
-
If you are deploying multiple components or to multiple environments from a single workflow, you need to provide the command with a deployment name.
80
-
This identifies the deployment your are planning so that you can later on reference it to update its status.
81
-
This can be done as shown below:
82
-
61
+
* Anothe option is to use pipeline values. For example you could define the target version as follows:
62
+
+
83
63
[,yml]
84
64
----
85
-
jobs:
86
-
deploy-my-service:
87
-
executor: some-executor
88
-
steps:
89
-
- run: circleci run release plan <deploy-name> --environment-name=<some-environment-name> --component-name<=>some-component-name> --target-version=<some-version-name>
65
+
--target-version=<< pipeline.number >>
90
66
----
67
+
+
68
+
This configuration would yield a value with the following format `12345`.
91
69
92
-
In the example the positional argument `deploy-name` is the arbitrary value that will be used to identify the deployment and should be unique within the workflow.
93
-
If not specified, the deployment name will be set to `default`.
94
-
95
-
=== 2.2. Update the deploy status
70
+
=== 1.2. Update the deploy status
96
71
97
72
After deploying your application, you can update the status of the deployment to `RUNNING` by running the `circleci run release update` command in a new step.
98
73
@@ -163,7 +138,7 @@ echo "FAILURE_REASON='Deployment was not found'" > failure_reason.env
163
138
164
139
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.
165
140
166
-
=== 2.3 Update the deploy status to canceled
141
+
=== 1.3 Update the deploy status to canceled
167
142
168
143
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.
169
144
@@ -293,10 +268,26 @@ jobs:
293
268
294
269
** The `environment-name` specifies the target environment. If the environment does not exist, it will be created.
295
270
** The `component-name` parameter sets the name that will be displayed in the CircleCI UI.
296
-
** The `target-version` parameter should match the name of the version being deployed.
271
+
** The `target-version` parameter should match the name of the version being deployed. Some examples are provided <<examples-for-target-version,above>>.
297
272
** (Optional) You can provide the following parameter if required:
298
273
*** The `namespace` parameter can be provided to use a value other than `default`.
299
274
275
+
== Manage environments
276
+
277
+
In this guide we created an environment integration by supplying a name with the `--envionment-name` flag. This was an optional step. If you did not specify an environment CircleCI will have created one for you with the name `default`.
278
+
279
+
You can also create an environment integration manually in the CircleCI web app.
280
+
281
+
=== Create an environment integration
282
+
283
+
. In the link:https://app.circleci.com[CircleCI web app], select your org from the org cards on your user homepage.
284
+
. Select **Deploys** in the sidebar.
285
+
. Select the **Environments** tab.
286
+
. Select btn:[Create Environment Integration].
287
+
. Enter a name for your environment, and a description if you would like.
288
+
. Use the dropdown menu to choose your environment integration type. Choose the "Custom" option to follow along with this guide,. If you are deploying to your Kubernetes cluster you can or if you want to use the CircleCI release agent, then choose "Kubernetes Cluster" and head over to the xref:set-up-circleci-deploys.adoc[Release agent setup] page.
289
+
. Select btn:[Save and Continue].
290
+
300
291
== Manual configuration of automatically detected deploys
301
292
302
293
If you have some link:https://circleci.com/changelog/auto-generated-deploy-markers-are-being-sunset/[automatically detected deploy markers] you can consider manually configuring them. CircleCI no longer automatically creates deploy markers for you.
0 commit comments