@celilo/e2e 0.5.0 → 0.5.1
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.
|
@@ -34,20 +34,34 @@ echo "nameserver 100.100.0.1" > /etc/resolv.conf
|
|
|
34
34
|
# Create celilo data directory (Linux default: /var/lib/celilo/)
|
|
35
35
|
mkdir -p /var/lib/celilo/modules
|
|
36
36
|
|
|
37
|
-
#
|
|
38
|
-
#
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
# If the monorepo is mounted at /celilo, use it for shell completions (dev mode).
|
|
38
|
+
# Otherwise use the globally installed CLI from npm.
|
|
39
|
+
if [ -d /celilo/apps/celilo ]; then
|
|
40
|
+
CELILO_SRC="/celilo/apps/celilo/src/cli/index.ts"
|
|
41
|
+
CELILO_CMD="bun run $CELILO_SRC"
|
|
42
|
+
|
|
43
|
+
# Warn if node_modules are missing (developer forgot to bun install)
|
|
44
|
+
if [ ! -d /celilo/apps/celilo/node_modules/@clack ]; then
|
|
45
|
+
echo "WARNING: /celilo/apps/celilo/node_modules not found. Run 'cd apps/celilo && bun install' on the host."
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
# Generate zsh completions from source
|
|
49
|
+
mkdir -p /root/.zsh/completions
|
|
50
|
+
bun run "$CELILO_SRC" completion zsh > /root/.zsh/completions/_celilo 2>/dev/null || true
|
|
51
|
+
|
|
52
|
+
START_DIR="/celilo/apps/celilo"
|
|
53
|
+
else
|
|
54
|
+
CELILO_CMD="celilo"
|
|
55
|
+
START_DIR="/root"
|
|
56
|
+
|
|
57
|
+
# Generate zsh completions from npm-installed CLI
|
|
58
|
+
mkdir -p /root/.zsh/completions
|
|
59
|
+
celilo completion zsh > /root/.zsh/completions/_celilo 2>/dev/null || true
|
|
42
60
|
fi
|
|
43
61
|
|
|
44
|
-
#
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
# Shell setup: aliases and completion for zsh
|
|
49
|
-
cat > /root/.zshrc << 'ZSHRC'
|
|
50
|
-
export PATH="/root/.bun/bin:$PATH"
|
|
62
|
+
# Shell setup
|
|
63
|
+
cat > /root/.zshrc << ZSHRC
|
|
64
|
+
export PATH="/root/.bun/bin:/usr/local/bin:\$PATH"
|
|
51
65
|
|
|
52
66
|
# Simulated network overrides
|
|
53
67
|
export DDNS_ENDPOINT="http://100.64.0.55:8080/update"
|
|
@@ -69,27 +83,22 @@ bindkey '^R' history-incremental-search-backward
|
|
|
69
83
|
# Prompt
|
|
70
84
|
PROMPT='%F{cyan}celilo%f:%F{yellow}%~%f# '
|
|
71
85
|
|
|
72
|
-
# Commands
|
|
73
|
-
|
|
74
|
-
c() { celilo "$@"; }
|
|
86
|
+
# Commands — celilo shim in /usr/local/bin prefers source when /celilo is mounted
|
|
87
|
+
alias c='celilo'
|
|
75
88
|
alias ll='ls -la'
|
|
76
89
|
|
|
77
|
-
# Tab completion
|
|
78
|
-
fpath=(~/.zsh/completions
|
|
90
|
+
# Tab completion
|
|
91
|
+
fpath=(~/.zsh/completions \$fpath)
|
|
79
92
|
autoload -Uz compinit && compinit -u
|
|
80
93
|
|
|
81
|
-
|
|
82
|
-
compdef _celilo c
|
|
83
|
-
|
|
84
|
-
cd /celilo/apps/celilo
|
|
94
|
+
cd $START_DIR
|
|
85
95
|
ZSHRC
|
|
86
96
|
|
|
87
|
-
#
|
|
88
|
-
cat > /root/.bashrc <<
|
|
89
|
-
export PATH="/root/.bun/bin
|
|
90
|
-
alias celilo='bun run /celilo/apps/celilo/src/cli/index.ts'
|
|
97
|
+
# Bash fallback (for non-zsh shells)
|
|
98
|
+
cat > /root/.bashrc << BASHRC
|
|
99
|
+
export PATH="/root/.bun/bin:/usr/local/bin:\$PATH"
|
|
91
100
|
alias c='celilo'
|
|
92
|
-
cd
|
|
101
|
+
cd $START_DIR
|
|
93
102
|
BASHRC
|
|
94
103
|
|
|
95
104
|
echo "Management machine ready"
|
|
@@ -22,13 +22,13 @@ RUN update-ca-certificates
|
|
|
22
22
|
# Point apt at the simulated apt cache proxy (for runtime apt usage)
|
|
23
23
|
RUN echo 'Acquire::http::Proxy "http://100.64.0.2:3142";' > /etc/apt/apt.conf.d/00proxy
|
|
24
24
|
|
|
25
|
-
# Install celilo CLI from npm
|
|
26
|
-
|
|
25
|
+
# Install celilo CLI from npm. bun installs the bin to /usr/local/bin/celilo
|
|
26
|
+
# on the oven/bun base image. We rename it so our shim can fall back to it.
|
|
27
|
+
RUN bun add -g @celilo/cli@0.1.5 \
|
|
28
|
+
&& mv /usr/local/bin/celilo /usr/local/bin/celilo-npm
|
|
27
29
|
|
|
28
30
|
# Shim: prefer /celilo source when mounted (dev loop), fall back to npm install.
|
|
29
|
-
|
|
30
|
-
# instead of the pinned npm version — critical for iterating on fixes.
|
|
31
|
-
RUN printf '#!/bin/bash\nif [ -d /celilo/apps/celilo ]; then\n exec bun run /celilo/apps/celilo/src/cli/index.ts "$@"\nfi\nexec /root/.bun/bin/celilo "$@"\n' > /usr/local/bin/celilo \
|
|
31
|
+
RUN printf '#!/bin/bash\nif [ -d /celilo/apps/celilo ]; then\n exec bun run /celilo/apps/celilo/src/cli/index.ts "$@"\nfi\nexec /usr/local/bin/celilo-npm "$@"\n' > /usr/local/bin/celilo \
|
|
32
32
|
&& chmod +x /usr/local/bin/celilo
|
|
33
33
|
|
|
34
34
|
# Standard modules pre-packaged as .netapp files — built by e2e-build.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celilo/e2e",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "E2E test infrastructure for Celilo-deployed applications. Provides a simulated internet with DNS hierarchy, ACME server, firewalls, and target machines in Docker.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
package/src/container-manager.ts
CHANGED
|
@@ -108,9 +108,11 @@ function dockerExecAsync(
|
|
|
108
108
|
timeoutMs = 60_000,
|
|
109
109
|
): Promise<ExecResult> {
|
|
110
110
|
return new Promise((resolve) => {
|
|
111
|
+
// stdbuf -oL forces line-buffered stdout so output streams in real time
|
|
112
|
+
// rather than appearing in one burst when the process's buffer flushes.
|
|
111
113
|
const args = [
|
|
112
114
|
'compose', '-f', COMPOSE_FILE, '-p', projectName,
|
|
113
|
-
'exec', '-T', container, 'bash', '-c', cmd,
|
|
115
|
+
'exec', '-T', container, 'stdbuf', '-oL', 'bash', '-c', cmd,
|
|
114
116
|
];
|
|
115
117
|
const child = spawn('docker', args, { cwd: composeDir });
|
|
116
118
|
|