toml-combine 0.1.9__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. {toml_combine-0.1.9 → toml_combine-0.2.0}/.github/workflows/ci.yml +2 -2
  2. {toml_combine-0.1.9 → toml_combine-0.2.0}/.pre-commit-config.yaml +2 -2
  3. {toml_combine-0.1.9 → toml_combine-0.2.0}/PKG-INFO +105 -132
  4. {toml_combine-0.1.9 → toml_combine-0.2.0}/README.md +103 -130
  5. {toml_combine-0.1.9 → toml_combine-0.2.0}/pyproject.toml +1 -1
  6. {toml_combine-0.1.9 → toml_combine-0.2.0}/tests/test.toml +0 -17
  7. toml_combine-0.2.0/tests/test_cli.py +58 -0
  8. {toml_combine-0.1.9 → toml_combine-0.2.0}/tests/test_combiner.py +25 -114
  9. toml_combine-0.2.0/tests/test_lib.py +115 -0
  10. toml_combine-0.2.0/toml_combine/__init__.py +5 -0
  11. {toml_combine-0.1.9 → toml_combine-0.2.0}/toml_combine/cli.py +29 -11
  12. {toml_combine-0.1.9 → toml_combine-0.2.0}/toml_combine/combiner.py +30 -109
  13. {toml_combine-0.1.9 → toml_combine-0.2.0}/toml_combine/exceptions.py +4 -0
  14. toml_combine-0.1.9/toml_combine/__init__.py → toml_combine-0.2.0/toml_combine/lib.py +12 -9
  15. toml_combine-0.2.0/toml_combine/toml.py +27 -0
  16. {toml_combine-0.1.9 → toml_combine-0.2.0}/uv.lock +11 -2
  17. toml_combine-0.1.9/tests/test_cli.py +0 -15
  18. toml_combine-0.1.9/tests/test_lib.py +0 -65
  19. toml_combine-0.1.9/toml_combine/toml.py +0 -17
  20. {toml_combine-0.1.9 → toml_combine-0.2.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  21. {toml_combine-0.1.9 → toml_combine-0.2.0}/.github/renovate.json5 +0 -0
  22. {toml_combine-0.1.9 → toml_combine-0.2.0}/tests/result.json +0 -0
  23. {toml_combine-0.1.9 → toml_combine-0.2.0}/toml_combine/__main__.py +0 -0
@@ -29,7 +29,7 @@ jobs:
29
29
  - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
30
30
 
31
31
  - name: Install the latest version of uv
32
- uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5
32
+ uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 # v5
33
33
  with:
34
34
  python-version: ${{ matrix.python-version }}
35
35
 
@@ -53,7 +53,7 @@ jobs:
53
53
  ref: ${{ github.ref }}
54
54
 
55
55
  - name: Install the latest version of uv
56
- uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5
56
+ uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 # v5
57
57
 
58
58
  - name: Build wheel & sdist
59
59
  run: uv build
@@ -22,11 +22,11 @@ repos:
22
22
  - id: mixed-line-ending
23
23
  - repo: https://github.com/astral-sh/uv-pre-commit
24
24
  # uv version.
25
- rev: 0.6.12
25
+ rev: 0.6.13
26
26
  hooks:
27
27
  - id: uv-lock
28
28
  - repo: https://github.com/astral-sh/ruff-pre-commit
29
- rev: v0.11.0
29
+ rev: v0.11.4
30
30
  hooks:
31
31
  - id: ruff
32
32
  args: [--fix, --unsafe-fixes, --show-fixes]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: toml-combine
3
- Version: 0.1.9
3
+ Version: 0.2.0
4
4
  Summary: A tool for combining complex configurations in TOML format.
5
5
  Author-email: Joachim Jablon <ewjoachim@gmail.com>
6
6
  License-Expression: MIT
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Requires-Python: >=3.9
17
- Requires-Dist: tomli>=2.2.1
17
+ Requires-Dist: tomlkit
18
18
  Description-Content-Type: text/markdown
19
19
 
20
20
  # Toml-combine
@@ -35,12 +35,6 @@ The configuration file is usually a TOML file. Here's a small example:
35
35
  [dimensions]
36
36
  environment = ["production", "staging"]
37
37
 
38
- [[output]]
39
- environment = "production"
40
-
41
- [[output]]
42
- environment = "staging"
43
-
44
38
  [default]
45
39
  name = "my-service"
46
40
  registry = "gcr.io/my-project/"
@@ -61,16 +55,6 @@ Dimensions lets you describe the main "thing" that makes the outputs differents,
61
55
  service might be `frontend` or `backend`. Some combinations of dimensions might not
62
56
  exists, for example, maybe there's no `staging` in `eu`.
63
57
 
64
- ### Outputs
65
-
66
- Create a `output` for each configuration you want to generate, and specify the
67
- dimensions relevant for this output. It's ok to omit some dimensions when they're not
68
- used for a given output.
69
-
70
- > [!Note]
71
- > Defining a list as the value of one or more dimensions in a output
72
- > is a shorthand for defining all combinations of dimensions
73
-
74
58
  ### Default
75
59
 
76
60
  The common configuration to start from, before we start overlaying overrides on top.
@@ -93,7 +77,7 @@ specific to more specific, each one overriding the values of the previous ones:
93
77
 
94
78
  ### The configuration itself
95
79
 
96
- Under the layer of `dimensions/output/default/override` system, what you actually define
80
+ Under the layer of `dimensions/default/override/mapping` system, what you actually define
97
81
  in the configuration is completely up to you. That said, only nested
98
82
  "dictionnaries"/"objects"/"tables"/"mapping" (those are all the same things in
99
83
  Python/JS/Toml lingo) will be merged between the default and the overrides, while
@@ -110,9 +94,6 @@ Let's look at an example:
110
94
  [dimensions]
111
95
  environment = ["production", "staging"]
112
96
 
113
- [[output]]
114
- environment = ["production", "staging"]
115
-
116
97
  [default]
117
98
  fruits = [{name="apple", color="red"}]
118
99
 
@@ -121,17 +102,16 @@ when.environment = "staging"
121
102
  fruits = [{name="orange", color="orange"}]
122
103
  ```
123
104
 
124
- In this example, on staging, `fruits` is `[{name="orange", color="orange"}]` and not `[{name="apple", color="red"}, {name="orange", color="orange"}]`.
125
- The only way to get multiple values to be merged is if they are tables: you'll need
105
+ In this example, with `{"environment": "staging"}`, `fruits` is
106
+ `[{name="orange", color="orange"}]` and not
107
+ `[{name="apple", color="red"}, {name="orange", color="orange"}]`.
108
+ The only way to get multiple values to be merged is if they are dicts: you'll need
126
109
  to chose an element to become the key:
127
110
 
128
111
  ```toml
129
112
  [dimensions]
130
113
  environment = ["production", "staging"]
131
114
 
132
- [[output]]
133
- environment = ["production", "staging"]
134
-
135
115
  [default]
136
116
  fruits.apple.color = "red"
137
117
 
@@ -146,16 +126,29 @@ This example is simple because `name` is a natural choice for the key. In some c
146
126
  the choice is less natural, but you can always decide to name the elements of your
147
127
  list and use that name as a key. Also, yes, you'll loose ordering.
148
128
 
149
- ### CLI
129
+ ### Mapping
150
130
 
151
- ```console
152
- $ toml-combine {path/to/config.toml}
153
- ```
131
+ When you call the tool either with the CLI or the lib (see both below), you will have to
132
+ provide a mapping of the desired dimentions. These values will be compared to overrides
133
+ to apply overrides when relevant. It's ok to omit some dimensions, corresponding
134
+ overrides won't be selected. The mapping you pass is also returned in the output as a
135
+ dict under the `dimensions` key.
136
+
137
+ By default, the output is `toml` though you can switch to `json` with `--format=json`
154
138
 
155
- Generates all the outputs described by the given TOML config.
139
+ ## CLI
156
140
 
157
- Note that you can restrict generation to some dimension values by passing
158
- `--{dimension}={value}`
141
+ Example with the config from the previous section:
142
+
143
+ ```console
144
+ $ toml-combine path/to/config.toml --environment=staging
145
+ [dimensions]
146
+ environment = "staging"
147
+
148
+ [fruits]
149
+ apple.color = "red"
150
+ orange.color = "orange"
151
+ ```
159
152
 
160
153
  ## Lib
161
154
 
@@ -163,40 +156,24 @@ Note that you can restrict generation to some dimension values by passing
163
156
  import toml_combine
164
157
 
165
158
 
166
- result = toml_combine.combine(
167
- config_file=config_file,
168
- environment=["production", "staging"],
169
- type="job",
170
- job=["manage", "special-command"],
171
- )
159
+ result = toml_combine.combine(config_file=config_file, environment="staging")
172
160
 
173
161
  print(result)
174
162
  {
175
- "production-job-manage": {...},
176
- "production-job-special-command": {...},
177
- "staging-job-manage": {...},
178
- "staging-job-special-command": {...},
163
+ "dimensions": {"environment": "staging"},
164
+ "fruits": {"apple": {"color": "red"}, "orange": {"color": "orange"}}
179
165
  }
180
166
  ```
181
167
 
182
- You can pass either `config` (TOML string or dict) or `config_file` (`pathlib.Path` or string path) to `combine()`. Additional `kwargs` restrict the output.
168
+ You can pass either `config` (TOML string or dict) or `config_file` (`pathlib.Path` or string path) to `combine()`. All other `kwargs` specify the mapping you want.
183
169
 
184
- ### A bigger example
170
+ ## A bigger example
185
171
 
186
172
  ```toml
187
173
  [dimensions]
188
174
  environment = ["production", "staging", "dev"]
189
175
  service = ["frontend", "backend"]
190
176
 
191
- # All 4 combinations of those values will exist
192
- [[output]]
193
- environment = ["production", "staging"]
194
- service = ["frontend", "backend"]
195
-
196
- # On dev, the "service" is not defined. That's ok.
197
- [[output]]
198
- environment = "dev"
199
-
200
177
  [default]
201
178
  registry = "gcr.io/my-project/"
202
179
  service_account = "my-service-account"
@@ -225,81 +202,77 @@ container.env.ENABLE_EXPENSIVE_MONITORING = false
225
202
 
226
203
  This produces the following configs:
227
204
 
228
- ```json
229
- {
230
- "production-frontend-eu": {
231
- "dimensions": {
232
- "environment": "production",
233
- "service": "frontend",
234
- "region": "eu"
235
- },
236
- "registry": "gcr.io/my-project/",
237
- "service_account": "my-service-account",
238
- "name": "service-frontend",
239
- "container": {
240
- "image_name": "my-image-frontend"
241
- }
242
- },
243
- "production-backend-eu": {
244
- "dimensions": {
245
- "environment": "production",
246
- "service": "backend",
247
- "region": "eu"
248
- },
249
- "registry": "gcr.io/my-project/",
250
- "service_account": "my-service-account",
251
- "name": "service-backend",
252
- "container": {
253
- "image_name": "my-image-backend",
254
- "port": 8080
255
- }
256
- },
257
- "staging-frontend-eu": {
258
- "dimensions": {
259
- "environment": "staging",
260
- "service": "frontend",
261
- "region": "eu"
262
- },
263
- "registry": "gcr.io/my-project/",
264
- "service_account": "my-service-account",
265
- "name": "service-frontend",
266
- "container": {
267
- "image_name": "my-image-frontend"
268
- }
269
- },
270
- "staging-backend-eu": {
271
- "dimensions": {
272
- "environment": "staging",
273
- "service": "backend",
274
- "region": "eu"
275
- },
276
- "registry": "gcr.io/my-project/",
277
- "service_account": "my-service-account",
278
- "name": "service-backend",
279
- "container": {
280
- "image_name": "my-image-backend",
281
- "port": 8080,
282
- "env": {
283
- "ENABLE_EXPENSIVE_MONITORING": false
284
- }
285
- }
286
- },
287
- "dev-backend": {
288
- "dimensions": {
289
- "environment": "dev",
290
- "service": "backend"
291
- },
292
- "registry": "gcr.io/my-project/",
293
- "service_account": "my-service-account",
294
- "name": "service-backend",
295
- "container": {
296
- "env": {
297
- "DEBUG": true,
298
- "ENABLE_EXPENSIVE_MONITORING": false
299
- },
300
- "image_name": "my-image-backend",
301
- "port": 8080
302
- }
303
- }
304
- }
205
+ ```console
206
+ $ uv run toml-combine example.toml --environment=production --service=frontend
207
+ registry = "gcr.io/my-project/"
208
+ service_account = "my-service-account"
209
+ name = "service-frontend"
210
+ [dimensions]
211
+ environment = "production"
212
+ service = "frontend"
213
+
214
+ [container]
215
+ image_name = "my-image-frontend"
216
+ ```
217
+
218
+ ```console
219
+ $ toml-combine example.toml --environment=production --service=backend
220
+ registry = "gcr.io/my-project/"
221
+ service_account = "my-service-account"
222
+ name = "service-backend"
223
+ [dimensions]
224
+ environment = "production"
225
+ service = "backend"
226
+
227
+ [container]
228
+ image_name = "my-image-backend"
229
+ port = 8080
230
+ ```
231
+
232
+ ```console
233
+ $ toml-combine example.toml --environment=staging --service=frontend
234
+ registry = "gcr.io/my-project/"
235
+ service_account = "my-service-account"
236
+ name = "service-frontend"
237
+ [dimensions]
238
+ environment = "staging"
239
+ service = "frontend"
240
+
241
+ [container]
242
+ image_name = "my-image-frontend"
243
+ ```
244
+
245
+ ```console
246
+ $ toml-combine example.toml --environment=staging --service=backend
247
+ registry = "gcr.io/my-project/"
248
+ service_account = "my-service-account"
249
+ name = "service-backend"
250
+ [dimensions]
251
+ environment = "staging"
252
+ service = "backend"
253
+
254
+ [container]
255
+ image_name = "my-image-backend"
256
+ port = 8080
257
+
258
+ [container.env]
259
+ ENABLE_EXPENSIVE_MONITORING = false
260
+ ```
261
+
262
+ ```console
263
+ $ toml-combine example.toml --environment=dev --service=backend
264
+ registry = "gcr.io/my-project/"
265
+ service_account = "my-service-account"
266
+ name = "service-backend"
267
+ [dimensions]
268
+ environment = "dev"
269
+ service = "backend"
270
+
271
+ [container]
272
+ image_name = "my-image-backend"
273
+ port = 8080
274
+ [container.env]
275
+ DEBUG = true
276
+ ENABLE_EXPENSIVE_MONITORING = false
277
+
305
278
  ```
@@ -16,12 +16,6 @@ The configuration file is usually a TOML file. Here's a small example:
16
16
  [dimensions]
17
17
  environment = ["production", "staging"]
18
18
 
19
- [[output]]
20
- environment = "production"
21
-
22
- [[output]]
23
- environment = "staging"
24
-
25
19
  [default]
26
20
  name = "my-service"
27
21
  registry = "gcr.io/my-project/"
@@ -42,16 +36,6 @@ Dimensions lets you describe the main "thing" that makes the outputs differents,
42
36
  service might be `frontend` or `backend`. Some combinations of dimensions might not
43
37
  exists, for example, maybe there's no `staging` in `eu`.
44
38
 
45
- ### Outputs
46
-
47
- Create a `output` for each configuration you want to generate, and specify the
48
- dimensions relevant for this output. It's ok to omit some dimensions when they're not
49
- used for a given output.
50
-
51
- > [!Note]
52
- > Defining a list as the value of one or more dimensions in a output
53
- > is a shorthand for defining all combinations of dimensions
54
-
55
39
  ### Default
56
40
 
57
41
  The common configuration to start from, before we start overlaying overrides on top.
@@ -74,7 +58,7 @@ specific to more specific, each one overriding the values of the previous ones:
74
58
 
75
59
  ### The configuration itself
76
60
 
77
- Under the layer of `dimensions/output/default/override` system, what you actually define
61
+ Under the layer of `dimensions/default/override/mapping` system, what you actually define
78
62
  in the configuration is completely up to you. That said, only nested
79
63
  "dictionnaries"/"objects"/"tables"/"mapping" (those are all the same things in
80
64
  Python/JS/Toml lingo) will be merged between the default and the overrides, while
@@ -91,9 +75,6 @@ Let's look at an example:
91
75
  [dimensions]
92
76
  environment = ["production", "staging"]
93
77
 
94
- [[output]]
95
- environment = ["production", "staging"]
96
-
97
78
  [default]
98
79
  fruits = [{name="apple", color="red"}]
99
80
 
@@ -102,17 +83,16 @@ when.environment = "staging"
102
83
  fruits = [{name="orange", color="orange"}]
103
84
  ```
104
85
 
105
- In this example, on staging, `fruits` is `[{name="orange", color="orange"}]` and not `[{name="apple", color="red"}, {name="orange", color="orange"}]`.
106
- The only way to get multiple values to be merged is if they are tables: you'll need
86
+ In this example, with `{"environment": "staging"}`, `fruits` is
87
+ `[{name="orange", color="orange"}]` and not
88
+ `[{name="apple", color="red"}, {name="orange", color="orange"}]`.
89
+ The only way to get multiple values to be merged is if they are dicts: you'll need
107
90
  to chose an element to become the key:
108
91
 
109
92
  ```toml
110
93
  [dimensions]
111
94
  environment = ["production", "staging"]
112
95
 
113
- [[output]]
114
- environment = ["production", "staging"]
115
-
116
96
  [default]
117
97
  fruits.apple.color = "red"
118
98
 
@@ -127,16 +107,29 @@ This example is simple because `name` is a natural choice for the key. In some c
127
107
  the choice is less natural, but you can always decide to name the elements of your
128
108
  list and use that name as a key. Also, yes, you'll loose ordering.
129
109
 
130
- ### CLI
110
+ ### Mapping
131
111
 
132
- ```console
133
- $ toml-combine {path/to/config.toml}
134
- ```
112
+ When you call the tool either with the CLI or the lib (see both below), you will have to
113
+ provide a mapping of the desired dimentions. These values will be compared to overrides
114
+ to apply overrides when relevant. It's ok to omit some dimensions, corresponding
115
+ overrides won't be selected. The mapping you pass is also returned in the output as a
116
+ dict under the `dimensions` key.
117
+
118
+ By default, the output is `toml` though you can switch to `json` with `--format=json`
135
119
 
136
- Generates all the outputs described by the given TOML config.
120
+ ## CLI
137
121
 
138
- Note that you can restrict generation to some dimension values by passing
139
- `--{dimension}={value}`
122
+ Example with the config from the previous section:
123
+
124
+ ```console
125
+ $ toml-combine path/to/config.toml --environment=staging
126
+ [dimensions]
127
+ environment = "staging"
128
+
129
+ [fruits]
130
+ apple.color = "red"
131
+ orange.color = "orange"
132
+ ```
140
133
 
141
134
  ## Lib
142
135
 
@@ -144,40 +137,24 @@ Note that you can restrict generation to some dimension values by passing
144
137
  import toml_combine
145
138
 
146
139
 
147
- result = toml_combine.combine(
148
- config_file=config_file,
149
- environment=["production", "staging"],
150
- type="job",
151
- job=["manage", "special-command"],
152
- )
140
+ result = toml_combine.combine(config_file=config_file, environment="staging")
153
141
 
154
142
  print(result)
155
143
  {
156
- "production-job-manage": {...},
157
- "production-job-special-command": {...},
158
- "staging-job-manage": {...},
159
- "staging-job-special-command": {...},
144
+ "dimensions": {"environment": "staging"},
145
+ "fruits": {"apple": {"color": "red"}, "orange": {"color": "orange"}}
160
146
  }
161
147
  ```
162
148
 
163
- You can pass either `config` (TOML string or dict) or `config_file` (`pathlib.Path` or string path) to `combine()`. Additional `kwargs` restrict the output.
149
+ You can pass either `config` (TOML string or dict) or `config_file` (`pathlib.Path` or string path) to `combine()`. All other `kwargs` specify the mapping you want.
164
150
 
165
- ### A bigger example
151
+ ## A bigger example
166
152
 
167
153
  ```toml
168
154
  [dimensions]
169
155
  environment = ["production", "staging", "dev"]
170
156
  service = ["frontend", "backend"]
171
157
 
172
- # All 4 combinations of those values will exist
173
- [[output]]
174
- environment = ["production", "staging"]
175
- service = ["frontend", "backend"]
176
-
177
- # On dev, the "service" is not defined. That's ok.
178
- [[output]]
179
- environment = "dev"
180
-
181
158
  [default]
182
159
  registry = "gcr.io/my-project/"
183
160
  service_account = "my-service-account"
@@ -206,81 +183,77 @@ container.env.ENABLE_EXPENSIVE_MONITORING = false
206
183
 
207
184
  This produces the following configs:
208
185
 
209
- ```json
210
- {
211
- "production-frontend-eu": {
212
- "dimensions": {
213
- "environment": "production",
214
- "service": "frontend",
215
- "region": "eu"
216
- },
217
- "registry": "gcr.io/my-project/",
218
- "service_account": "my-service-account",
219
- "name": "service-frontend",
220
- "container": {
221
- "image_name": "my-image-frontend"
222
- }
223
- },
224
- "production-backend-eu": {
225
- "dimensions": {
226
- "environment": "production",
227
- "service": "backend",
228
- "region": "eu"
229
- },
230
- "registry": "gcr.io/my-project/",
231
- "service_account": "my-service-account",
232
- "name": "service-backend",
233
- "container": {
234
- "image_name": "my-image-backend",
235
- "port": 8080
236
- }
237
- },
238
- "staging-frontend-eu": {
239
- "dimensions": {
240
- "environment": "staging",
241
- "service": "frontend",
242
- "region": "eu"
243
- },
244
- "registry": "gcr.io/my-project/",
245
- "service_account": "my-service-account",
246
- "name": "service-frontend",
247
- "container": {
248
- "image_name": "my-image-frontend"
249
- }
250
- },
251
- "staging-backend-eu": {
252
- "dimensions": {
253
- "environment": "staging",
254
- "service": "backend",
255
- "region": "eu"
256
- },
257
- "registry": "gcr.io/my-project/",
258
- "service_account": "my-service-account",
259
- "name": "service-backend",
260
- "container": {
261
- "image_name": "my-image-backend",
262
- "port": 8080,
263
- "env": {
264
- "ENABLE_EXPENSIVE_MONITORING": false
265
- }
266
- }
267
- },
268
- "dev-backend": {
269
- "dimensions": {
270
- "environment": "dev",
271
- "service": "backend"
272
- },
273
- "registry": "gcr.io/my-project/",
274
- "service_account": "my-service-account",
275
- "name": "service-backend",
276
- "container": {
277
- "env": {
278
- "DEBUG": true,
279
- "ENABLE_EXPENSIVE_MONITORING": false
280
- },
281
- "image_name": "my-image-backend",
282
- "port": 8080
283
- }
284
- }
285
- }
186
+ ```console
187
+ $ uv run toml-combine example.toml --environment=production --service=frontend
188
+ registry = "gcr.io/my-project/"
189
+ service_account = "my-service-account"
190
+ name = "service-frontend"
191
+ [dimensions]
192
+ environment = "production"
193
+ service = "frontend"
194
+
195
+ [container]
196
+ image_name = "my-image-frontend"
197
+ ```
198
+
199
+ ```console
200
+ $ toml-combine example.toml --environment=production --service=backend
201
+ registry = "gcr.io/my-project/"
202
+ service_account = "my-service-account"
203
+ name = "service-backend"
204
+ [dimensions]
205
+ environment = "production"
206
+ service = "backend"
207
+
208
+ [container]
209
+ image_name = "my-image-backend"
210
+ port = 8080
211
+ ```
212
+
213
+ ```console
214
+ $ toml-combine example.toml --environment=staging --service=frontend
215
+ registry = "gcr.io/my-project/"
216
+ service_account = "my-service-account"
217
+ name = "service-frontend"
218
+ [dimensions]
219
+ environment = "staging"
220
+ service = "frontend"
221
+
222
+ [container]
223
+ image_name = "my-image-frontend"
224
+ ```
225
+
226
+ ```console
227
+ $ toml-combine example.toml --environment=staging --service=backend
228
+ registry = "gcr.io/my-project/"
229
+ service_account = "my-service-account"
230
+ name = "service-backend"
231
+ [dimensions]
232
+ environment = "staging"
233
+ service = "backend"
234
+
235
+ [container]
236
+ image_name = "my-image-backend"
237
+ port = 8080
238
+
239
+ [container.env]
240
+ ENABLE_EXPENSIVE_MONITORING = false
241
+ ```
242
+
243
+ ```console
244
+ $ toml-combine example.toml --environment=dev --service=backend
245
+ registry = "gcr.io/my-project/"
246
+ service_account = "my-service-account"
247
+ name = "service-backend"
248
+ [dimensions]
249
+ environment = "dev"
250
+ service = "backend"
251
+
252
+ [container]
253
+ image_name = "my-image-backend"
254
+ port = 8080
255
+ [container.env]
256
+ DEBUG = true
257
+ ENABLE_EXPENSIVE_MONITORING = false
258
+
286
259
  ```