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/ROOT/partials/faq/dynamic-configuration-faq-snip.adoc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
[#pipeline-parameters-api]
2
2
=== I thought pipeline parameters could only be used with the API?
3
3
4
-
Previously, this was true. With the dynamic configuration feature, you can now set pipeline parameters dynamically, before the pipeline is executed (triggered from either the API or a webhook—a push event to your VCS).
4
+
Previously, this was true but you can now set pipeline parameters dynamically, before the pipeline is executed. The pipeline parameters for the continuation configuration can be set by using the link:https://circleci.com/developer/orbs/orb/circleci/continuation[continuation orb] in the setup configuration. The pipeline associated with the setup configuration can be triggered via either the API or an event in your VCS.
5
5
6
6
[#can-i-use-a-custom-executor]
7
7
=== Can I use a custom executor?
@@ -11,8 +11,8 @@ Custom executors can be used, but require certain dependencies to be installed f
11
11
[#what-is-the-continuation-orb]
12
12
=== What is the continuation orb?
13
13
14
-
The `continuation` orb assists you in managing the pipeline continuation process. The
15
-
`continuation` orb wraps an API call to link:https://circleci.com/docs/api/v2/#operation/continuePipeline[`continuePipeline`]. Refer to the link:https://circleci.com/developer/orbs/orb/circleci/continuation[`continuation`] orb documentation for more information.
14
+
The continuation orb assists you in managing the pipeline continuation process. The
15
+
continuation orb wraps an API call to the link:https://circleci.com/docs/api/v2/#operation/continuePipeline[Continue a pipeline API endpoint]. Refer to the link:https://circleci.com/developer/orbs/orb/circleci/continuation[continuation orb] documentation for more information.
16
16
17
17
[#possible-to-not-use-continuation-orb]
18
18
=== Is it possible to not use the continuation orb?
Copy file name to clipboardExpand all lines: docs/guides/modules/orchestrate/pages/dynamic-config.adoc
+27-12Lines changed: 27 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ These steps make dynamic configuration features available for your project, but
33
33
34
34
=== Use dynamic configuration
35
35
36
-
Add the key `setup: true` to the top level of your _parent_ configuration file to designate that `config.yml` as a `setup` configuration.
36
+
Add the key `setup: true` to the top level of your _parent_ configuration file to designate that `config.yml` as a setup configuration.
37
37
38
38
[,yaml]
39
39
----
@@ -48,14 +48,19 @@ For some basic examples of using dynamic configuration, see the xref:using-dynam
48
48
49
49
Some constraints on continuing pipelines from a `setup: true` configuration are as follows:
50
50
51
-
- The `setup` configuration must be `version: 2.1`.
52
-
- The `setup` configuration must only allow one workflow to run in each pipeline. For example:
51
+
- The setup configuration must be `version: 2.1`.
52
+
- The setup configuration must only allow one workflow to run in each pipeline. For example:
53
53
** Have only one workflow configured.
54
54
** Use logic conditions to ensure only one workflow is run for each pipeline.
55
55
- A pipeline can only be continued once. A pipeline cannot be continued with another setup configuration. Workflow reruns will fail as part of this restriction. Rather than rerun a setup workflow you can trigger a new pipeline.
56
56
- A pipeline can only be continued within six hours of its creation.
57
-
- Pipeline parameters submitted at continuation time cannot overlap with pipeline parameters submitted at trigger (setup) time.
58
-
- Pipeline parameters declared in the `setup` configuration must also be declared in the continuation configuration. These parameters can be used at continuation time. For more information, see the xref:pipeline-variables.adoc#pipeline-parameters-and-dynamic-configuration[Pipeline values and parameters] page.
57
+
- If you declare a pipeline parameter with the same name and type in both the setup and continuation configuration files, but with different default values, the default values apply respectively to each configuration.
58
+
- You can set the value of a pipeline parameter declared in the continuation configuration to a value other than the default. To do so, specify the parameter's name and value when calling the `continue` job or command from the link:https://circleci.com/developer/orbs/orb/circleci/continuation[continuation orb] using the `parameters` parameter.
59
+
- The `continue` job/command will fail with the error {"message":"Conflicting pipeline parameters."} when all three of these conditions occur:
60
+
61
+
1. The same pipeline parameter is declared in both the setup and the continuation configurations.
62
+
2. The `continue` job/command attempts to pass this pipeline parameter via the `parameters` parameter.
63
+
3. The pipeline is triggered via the API or via the btn:[Trigger Pipeline] button, with a parameter value that differs from the default value specified in the setup configuration.
59
64
60
65
[#how-dynamic-config-works]
61
66
== How dynamic config works
@@ -86,22 +91,32 @@ Some examples of using dynamic configuration in CircleCI include:
86
91
* Share common configuration across projects by generating project-specific sections dynamically based on parameters.
87
92
* _Continue_ a pipeline, or generate and run a configuration based on where code has changed.
88
93
* Split up a configuration file into reusable fragments that can be dynamically assembled.
89
-
* Generate full CircleCI configurations from small company-specifiic configurations. For example, if you have many repositories with similar CI/CD requirements, you can generate a full CircleCI YAML configuration dynamically from small template configuration written in any configuration language.
94
+
* Generate full CircleCI configurations from small company-specifiic configurations. For example, if you have multiple repositories with similar CI/CD requirements, you can generate a full CircleCI YAML configuration dynamically from small template configuration written in any configuration language.
90
95
* When working with a language or framework that has its own configuration language, you can generate CircleCI config dynamically from existing configuration files.
91
96
92
97
=== Use path filtering for monorepos
93
98
94
-
Set up path filtering to set pipeline parameters and continuation configuration sources based on the location of changes in your repository.
99
+
In a link:https://circleci.com/blog/monorepo-dev-practices/[monorepo] setup:
100
+
101
+
* Set up path filtering to set pipeline parameters and continuation configuration sources based on the location of changes in your repository.
102
+
* You can use path filtering to avoid all your microservices/sub-projects being put through the entirety of your build, test, and deployment processes when any single update occurs.
95
103
96
-
In a monorepo (single repository) setup you can use path filtering to avoid all of your microservices/sub-projects being put through the entirety of your build, test, and deployment processes when any single update is introduced.
104
+
For example, you may have multiple projects within your repository (`project_1`, `project_2`, `project_3`). +
105
+
You can use path filtering to only run tests and deployment for `project_1` if a change is made in the `project_1` file set. The link:https://circleci.com/developer/orbs/orb/circleci/path-filtering[path filtering orb] is available to help simplify your configuration further.
97
106
98
-
For example, you may have multiple projects within your repository (`project_1`, `project_2`, `project_3`). You can use path filtering to only run tests and deployment for `project_1` if change happened in the `project_1` file set. The link:https://circleci.com/developer/orbs/orb/circleci/path-filtering[path filtering orb] is available to help simplify your configuration further. For a full example of path filtering, see the xref:using-dynamic-configuration.adoc#execute-specific-workflows-or-steps-based-on-which-files-are-modified[Dynamic configuration how-to guide].
107
+
For a full example of path filtering, see the xref:using-dynamic-configuration.adoc#execute-specific-workflows-or-steps-based-on-which-files-are-modified[Dynamic configuration how-to guide].
99
108
100
109
// #DIAGRAM OF PATH FILTERING FOR MONOREPO SETUP#
101
110
102
111
=== Use config splitting for microservices
103
112
104
-
For projects that consist of multiple modules, you may require a separate job/workflow to run for each module when changes are introduced. You can split your configuration up and store the config for each module separately within the module's directory, keeping related code and config together. Module jobs/workflows can be stored in multiple files as _fragments_ of a configuration. Instead of using one full `.circleci/config.yml` file, you can use dynamic configuration to combine these individual fragments into a full configuration when a pipeline is triggered. This scenario can also be referred to as _config splitting_.
113
+
For projects that consist of multiple modules, you may require a separate job/workflow to run for each module when changes are introduced.
114
+
115
+
You can split your configuration up and store the config for each module separately within the module's directory, keeping related code and config together.
116
+
117
+
Module jobs/workflows can be stored in multiple files as _fragments_ of a configuration. Instead of using one full `.circleci/config.yml` file, you can use dynamic configuration to combine these individual fragments into a full configuration when a pipeline is triggered.
118
+
119
+
This scenario is also referred to as _config splitting_.
Copy file name to clipboardExpand all lines: docs/guides/modules/orchestrate/pages/pipeline-variables.adoc
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -195,11 +195,12 @@ Pipeline parameters which are defined in configuration are always in scope, with
195
195
[#pipeline-parameters-and-dynamic-configuration]
196
196
=== Pipeline parameters and dynamic configuration
197
197
198
-
When using setup workflows to pass control of the pipeline to a second configuration, all pipeline parameters that are declared in the setup workflow must also be declared, with the same defaults, in the second configuration.
198
+
Parameters can be passed from the setup to the continuation workflow using the `continue` job or command from the link:https://circleci.com/developer/orbs/orb/circleci/continuation[continuation orb]. To pass these parameters use the `parameters` parameter from the `continue` job/command. Any parameters passed in this way must be declared as pipeline parameters in the continuation configuration.
199
199
200
-
When the setup workflow passes control to a second configuration, the parameters passed _to_ the setup workflow will be merged in with any parameters specified _in_the setup workflow, before being passed to the second configuration. When using dynamic configuration, the second configuration must tolerate receiving any parameters that the setup workflow's code passes, as well as any parameters that the setup workflow _could_ accept.
200
+
When a pipeline parameter is declared in both the setup and the continuation configurations, the pipeline will error if both the following conditions are met:
201
201
202
-
If there are name conflicts between pipeline parameters specified in a setup workflow and those specified in an API request when triggering a pipeline, the continuation process will fail, and the pipeline will error.
202
+
. The pipeline is triggered via the API.
203
+
. The pipeline parameter's value specified in the API request is different from the default value specified in the setup configuration.
203
204
204
205
More information on setup workflows can be found in the xref:dynamic-config.adoc#how-dynamic-config-works[How dynamic config works] section of the Dynamic Configuration overview.
0 commit comments