@tdk-landscape/tdk-cli-core 1.3.103 → 1.3.104
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.
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@tdk-landscape/tdk-cli-core)
|
|
4
4
|
[](https://packagephobia.com/result?p=@tdk-landscape/tdk-cli-core)
|
|
5
|
-
[](https://packagephobia.com/result?p=@tdk-landscape/tdk-cli-core)
|
|
6
6
|
[](https://github.com/tdk-landscape/tdk-cli-core/actions/workflows/ci.yml)
|
|
7
7
|
[](https://github.com/tdk-landscape/tdk-cli-core/actions/workflows/quickstart-e2e.yml)
|
|
8
8
|
[](https://github.com/tdk-landscape/tdk-cli-core/actions/workflows/erp-scale-e2e.yml)
|
package/cli/package.json
CHANGED
|
@@ -233,7 +233,12 @@ def _apply_manifest_defaults(manifest, resource_path):
|
|
|
233
233
|
# Validate custom dockerfile exists if specified
|
|
234
234
|
if 'dockerfile' in result:
|
|
235
235
|
custom_dockerfile = result['dockerfile']
|
|
236
|
-
|
|
236
|
+
# With a bring-your-own buildContext the dockerfile is relative to that context.
|
|
237
|
+
build_context = result.get('buildContext')
|
|
238
|
+
if build_context and build_context != '.':
|
|
239
|
+
dockerfile_path = resource_path + '/' + build_context + '/' + custom_dockerfile
|
|
240
|
+
else:
|
|
241
|
+
dockerfile_path = resource_path + '/' + custom_dockerfile
|
|
237
242
|
# BUG FIX: Run check from project root since Tilt may run from .tdk/.tdk-out/
|
|
238
243
|
project_root = os.environ.get('TDK_PROJECT_ROOT', '')
|
|
239
244
|
if project_root:
|
|
@@ -162,6 +162,10 @@
|
|
|
162
162
|
"description": "Custom Dockerfile path relative to resource directory. Optional for bring-your-own type.",
|
|
163
163
|
"type": "string"
|
|
164
164
|
},
|
|
165
|
+
"buildContext": {
|
|
166
|
+
"description": "Docker build context for a bring-your-own resource, relative to the resource directory. Defaults to the resource directory. When set, dockerfile is relative to this context.",
|
|
167
|
+
"type": "string"
|
|
168
|
+
},
|
|
165
169
|
"exposeViaProxy": {
|
|
166
170
|
"description": "Whether this bring-your-own resource receives a Traefik route. Defaults to true.",
|
|
167
171
|
"type": "boolean"
|
|
@@ -207,6 +207,12 @@ def _generate_single_backend_entry(resource_path, resource_name, res, manifest,
|
|
|
207
207
|
# context instead of the project root used by generated TDK apps.
|
|
208
208
|
context_prefix = '/'.join(['..'] * (len(resource_path.split('/')) + 1))
|
|
209
209
|
build_context = context_prefix + '/' + full_resource_path
|
|
210
|
+
# `buildContext` (relative to the service directory) moves the context
|
|
211
|
+
# to the source tree an imported Dockerfile lives in; `dockerfile` is then
|
|
212
|
+
# relative to that context, as in Compose.
|
|
213
|
+
custom_context = manifest.get('buildContext')
|
|
214
|
+
if custom_context and custom_context != '.':
|
|
215
|
+
build_context = build_context + '/' + custom_context
|
|
210
216
|
dockerfile = manifest.get('dockerfile', 'Dockerfile')
|
|
211
217
|
if dockerfile.startswith('./'):
|
|
212
218
|
dockerfile = dockerfile[2:]
|