@norskvideo/ctl-dev-kit 0.2.34 → 0.2.35
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.
|
@@ -208,6 +208,31 @@ jobs:
|
|
|
208
208
|
# in here and breaks a schema handed across the instance boundary.
|
|
209
209
|
bun node_modules/@norskvideo/ctl-dev-kit/conventions/zod-singleton.ts
|
|
210
210
|
'
|
|
211
|
+
# licenseTemplate.json records the entry a licence is minted from: this
|
|
212
|
+
# product at the image CI builds. One naming another image mints a licence
|
|
213
|
+
# that entitles nothing, first seen as a refused launch at the customer.
|
|
214
|
+
# The Studio checks pair this with check-product-name (the compose asks
|
|
215
|
+
# for what is recorded); an sdk-app names itself in its own handshake, so
|
|
216
|
+
# there is no Studio declaration to lint. Cheap, no secrets, every PR.
|
|
217
|
+
#
|
|
218
|
+
# The image name is CI's own rule: PUBLISH_IMAGE when set, else the build
|
|
219
|
+
# script's IMAGE_TAG default, tag stripped -- a licence matches the repo
|
|
220
|
+
# part alone, never the tag.
|
|
221
|
+
- name: Check this repo records its own licence
|
|
222
|
+
run: |
|
|
223
|
+
set -euo pipefail
|
|
224
|
+
product="$(sed -nE 's/.*PRODUCT_NAME[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/p' src/product/version.ts | head -1)"
|
|
225
|
+
[ -n "$product" ] || { echo "::error::could not read PRODUCT_NAME from src/product/version.ts"; exit 1; }
|
|
226
|
+
pub="$(sed -nE 's/^[[:space:]]*PUBLISH_IMAGE:[[:space:]]*"?([^" ]*)"?[[:space:]]*$/\1/p' .github/workflows/build-image.yml | head -1)"
|
|
227
|
+
def="$(sed -nE 's/.*IMAGE_TAG:-([^}]+)\}.*/\1/p' deployment/build-image.sh | head -1)"
|
|
228
|
+
ref="${pub:-$def}"
|
|
229
|
+
# A colon is a tag only after the last slash (a registry host may carry a port).
|
|
230
|
+
image="${ref%:*}"
|
|
231
|
+
case "${ref##*/}" in *:*) ;; *) image="$ref" ;; esac
|
|
232
|
+
[ -n "$image" ] || { echo "::error::could not determine the image this repo builds"; exit 1; }
|
|
233
|
+
nix develop .#build --command bun \
|
|
234
|
+
node_modules/@norskvideo/ctl-dev-kit/licence/check-template.ts \
|
|
235
|
+
licenseTemplate.json "$product" "$image"
|
|
211
236
|
- name: Reap the containers this job launched
|
|
212
237
|
# Whatever the tests did. A teardown cut short by a test timeout leaves
|
|
213
238
|
# its instance running on the shared Docker daemon (see JOB_REAP_STEP in
|