OXYGENHUB

The build image carries an npm cache of the extensions' lock files, for offline npm ci 50354f576ea6

Author
Andy McCall @andymccall <[email protected]>
When
· 2026-09-28 19:39 UTC
Signature
✔ signed by Andy McCall
Hash
50354f576ea675bc2cb06b6da14c4ea3bb3d87494d549ee8c1fd575da87d99ac
Depends on
e0918b887850 eb5c4db673e5
Depended on by
f3b5b86e23ef c8917cf1f931 60d848f2474b eba589f87e4f
In bookmarks
main newer-pipeline push-uses-login
In tags
v0.2.0 v0.3.0 v0.3.1 v0.4.0 v0.5.0 v0.5.1 v0.5.2 v0.5.3
Edits
8 atoms, 0 tree operations, 3 files

Browse the tree at this change

modified .oxyignore +1 −0
…
1 unchanged lines
2 2
*.vsix
3 3
images/rust/vendor/
4 4
images/rust/*.tar
5 +
images/rust/npm-cache/
modified images/rust/Dockerfile +6 −1
1 1
# The OxygenFlow build image (backlog F1b): Rust with rustfmt and clippy,
2 -
# Node, and every crate the Oxygen projects use, vendored, because jobs
2 +
# Node, every crate the Oxygen projects use, vendored, and an npm cache for
3 +
# the Oxygen extensions, because jobs
3 4
# have no network. Built by ./build.sh, which vendors the crates first.
4 5
FROM rust:1.97.1-slim-bookworm
5 6
…
13 unchanged lines
19 20
RUN echo "${NODE_SHA256}  /tmp/node.tar.xz" | sha256sum -c - \
20 21
 && tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 --exclude='*/include' --exclude='*/share/doc' \
21 22
 && rm /tmp/node.tar.xz
23 +
24 +
# npm's cache for the Oxygen extensions' lock files: `npm ci --offline
25 +
# --cache /opt/npm-cache` installs from it, read-only as it is.
26 +
COPY npm-cache /opt/npm-cache
22 27
23 28
# Cargo reads /.cargo/config.toml for anything under /, so /src uses the
24 29
# vendored crates; CARGO_HOME stays the default $HOME/.cargo (/tmp).
…
2 unchanged lines
modified images/rust/build.sh +11 −2
…
1 unchanged lines
2 2
# Build the OxygenFlow build image and write it as a root file system
3 3
# tarball for `flow rootfs import`. Run from any directory; the Oxygen
4 4
# projects are expected next to this repository (../oxygen, ../oxygenhub).
5 -
# Rebuild whenever a Cargo.lock of those projects changes.
5 +
# Rebuild whenever a Cargo.lock or package-lock.json of those projects changes.
6 6
set -eu
7 7
here=$(cd "$(dirname "$0")" && pwd)
8 8
dev=$(cd "$here/../../.." && pwd)
…
7 unchanged lines
16 16
    --sync "$dev/oxygenhub/Cargo.toml" \
17 17
    --sync "$dev/oxygenflow/Cargo.toml" \
18 18
    "$here/vendor" >/dev/null
19 +
# npm packages of the two extensions, into a cache `npm ci --offline` reads.
20 +
rm -rf "${here:?}/npm-cache"
21 +
for e in oxygen-vscode oxygenhub-vscode; do
22 +
    tmp=$(mktemp -d)
23 +
    cp "$dev/$e/package.json" "$dev/$e/package-lock.json" "$tmp/"
24 +
    (cd "$tmp" && npm ci --cache "$here/npm-cache" --ignore-scripts --no-audit --no-fund >/dev/null)
25 +
    rm -rf "${tmp:?}"
26 +
done
27 +
rm -rf "${here:?}/npm-cache/_logs"
19 28
docker build -q -t oxygenflow-build \
20 29
    --build-arg NODE_VERSION=$NODE_VERSION --build-arg NODE_SHA256=$NODE_SHA256 "$here"
21 30
id=$(docker create oxygenflow-build)
22 31
docker export "$id" -o "$out"
23 32
docker rm "$id" >/dev/null
24 -
rm -rf "$here/vendor"
33 +
rm -rf "${here:?}/vendor" "${here:?}/npm-cache"
25 34
echo "$out"