@norskvideo/ctl-dev-kit 0.1.8 → 0.1.9
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/build/build-bundle-image.sh +26 -4
- package/package.json +1 -1
|
@@ -18,9 +18,16 @@
|
|
|
18
18
|
#
|
|
19
19
|
# Everything else is auto-detected off PRODUCT_DIR, so a product opts in just by
|
|
20
20
|
# having the directory/script — no per-product flag to keep in sync:
|
|
21
|
+
# frontend/dist the frontend workspace's build output
|
|
22
|
+
# dashboards/ the dashboard workspace's build output
|
|
23
|
+
# components/lib the components workspace's build output
|
|
21
24
|
# native/ native addon(s) (probe's signer) -> beside bundle
|
|
22
25
|
# assets/ product-template assets (funke's PNGs)
|
|
23
26
|
# scripts/runtime-images.ts -> emits the norsk-ctl.runtime-images label
|
|
27
|
+
#
|
|
28
|
+
# Only backend/dist is required. A product with no frontend/dashboard/components
|
|
29
|
+
# workspace (reuters) stages those empty and builds the same as one that has all
|
|
30
|
+
# three (funke/probe/commentary).
|
|
24
31
|
set -euo pipefail
|
|
25
32
|
|
|
26
33
|
: "${PRODUCT_DIR:?build-bundle-image.sh: PRODUCT_DIR must be set by the wrapper}"
|
|
@@ -43,11 +50,26 @@ stage="$(mktemp -d)"
|
|
|
43
50
|
trap 'rm -rf "${stage}"' EXIT
|
|
44
51
|
|
|
45
52
|
echo "==> staging artifacts"
|
|
46
|
-
mkdir -p "${stage}/backend" "${stage}/frontend" "${stage}/components
|
|
53
|
+
mkdir -p "${stage}/backend" "${stage}/frontend/dist" "${stage}/components/lib" \
|
|
54
|
+
"${stage}/dashboards" "${stage}/native" "${stage}/assets"
|
|
55
|
+
# The backend bundle is the one non-negotiable payload — every bundle product has
|
|
56
|
+
# one, so a missing dist is a broken build, not an absent workspace.
|
|
47
57
|
cp -R "${PRODUCT_DIR}/backend/dist" "${stage}/backend/dist"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
58
|
+
|
|
59
|
+
# Frontend / dashboards / components are produced by the workspaces of the same
|
|
60
|
+
# name, so a product that has no such workspace never produces them (reuters:
|
|
61
|
+
# backend-only). Staged empty in that case, exactly as native/ and assets/ below
|
|
62
|
+
# — Dockerfile.bundle COPYs all six unconditionally, so the path must exist even
|
|
63
|
+
# when there is nothing to put in it.
|
|
64
|
+
if [ -d "${PRODUCT_DIR}/frontend/dist" ]; then
|
|
65
|
+
cp -R "${PRODUCT_DIR}/frontend/dist/." "${stage}/frontend/dist/"
|
|
66
|
+
fi
|
|
67
|
+
if [ -d "${PRODUCT_DIR}/dashboards" ]; then
|
|
68
|
+
cp -R "${PRODUCT_DIR}/dashboards/." "${stage}/dashboards/"
|
|
69
|
+
fi
|
|
70
|
+
if [ -d "${PRODUCT_DIR}/components/lib" ]; then
|
|
71
|
+
cp -R "${PRODUCT_DIR}/components/lib/." "${stage}/components/lib/"
|
|
72
|
+
fi
|
|
51
73
|
|
|
52
74
|
# Native addon(s): staged beside the bundle. Strip the build host's RUNPATH (nix
|
|
53
75
|
# store / repo-local paths) so the shipped .node carries no build-host paths; its
|