Skip to content

Commit 3ba549e

Browse files
committed
ci: fix installer smoke
1 parent e76f98a commit 3ba549e

6 files changed

Lines changed: 41 additions & 20 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Deploy to GitHub Pages
22

33
on:
4-
push:
5-
branches: [main]
64
workflow_dispatch:
75

86
permissions:

.github/workflows/install-smoke.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,20 @@ jobs:
1414
uses: actions/checkout@v4
1515

1616
- name: Build smoke image (root)
17-
run: docker build -t clawdbot-install-smoke:ci -f scripts/docker/install-sh-smoke/Dockerfile scripts/docker/install-sh-smoke
17+
run: docker build -t clawdbot-install-smoke:ci -f scripts/docker/install-sh-smoke/Dockerfile .
1818

1919
- name: Run install smoke (root)
2020
env:
21-
CLAWDBOT_INSTALL_URL: file://$GITHUB_WORKSPACE/public/install.sh
2221
CLAWDBOT_NO_ONBOARD: "1"
23-
run: docker run --rm -t -e CLAWDBOT_INSTALL_URL -e CLAWDBOT_NO_ONBOARD clawdbot-install-smoke:ci
22+
run: docker run --rm -t -e CLAWDBOT_NO_ONBOARD clawdbot-install-smoke:ci
2423

2524
- name: Build non-root image
26-
run: docker build -t clawdbot-install-nonroot:ci -f scripts/docker/install-sh-nonroot/Dockerfile scripts/docker/install-sh-nonroot
25+
run: docker build -t clawdbot-install-nonroot:ci -f scripts/docker/install-sh-nonroot/Dockerfile .
2726

2827
- name: Run install smoke (non-root + CLI)
2928
env:
30-
CLAWDBOT_INSTALL_URL: file://$GITHUB_WORKSPACE/public/install.sh
31-
CLAWDBOT_INSTALL_CLI_URL: file://$GITHUB_WORKSPACE/public/install-cli.sh
3229
CLAWDBOT_NO_ONBOARD: "1"
3330
run: |
3431
docker run --rm -t \
35-
-e CLAWDBOT_INSTALL_URL \
36-
-e CLAWDBOT_INSTALL_CLI_URL \
3732
-e CLAWDBOT_NO_ONBOARD \
3833
clawdbot-install-nonroot:ci

scripts/docker/install-sh-nonroot/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
FROM ubuntu:24.04
22

33
RUN apt-get update \
4-
&& apt-get install -y --no-install-recommends \
4+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
55
bash \
66
ca-certificates \
77
curl \
88
sudo \
9+
tzdata \
910
&& rm -rf /var/lib/apt/lists/*
1011

1112
RUN useradd -m -s /bin/bash app \
@@ -17,7 +18,10 @@ WORKDIR /home/app
1718
ENV NPM_CONFIG_FUND=false
1819
ENV NPM_CONFIG_AUDIT=false
1920

20-
COPY run.sh /usr/local/bin/clawdbot-install-nonroot
21-
RUN sudo chmod +x /usr/local/bin/clawdbot-install-nonroot
21+
COPY scripts/docker/install-sh-nonroot/run.sh /usr/local/bin/clawdbot-install-nonroot
22+
COPY public/install.sh /opt/clawdbot-install.sh
23+
COPY public/install-cli.sh /opt/clawdbot-install-cli.sh
24+
RUN sudo chmod +x /usr/local/bin/clawdbot-install-nonroot \
25+
&& sudo chmod a+r /opt/clawdbot-install.sh /opt/clawdbot-install-cli.sh
2226

2327
ENTRYPOINT ["/usr/local/bin/clawdbot-install-nonroot"]

scripts/docker/install-sh-nonroot/run.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
INSTALL_URL="${CLAWDBOT_INSTALL_URL:-https://clawd.bot/install.sh}"
5-
CLI_INSTALL_URL="${CLAWDBOT_INSTALL_CLI_URL:-https://clawd.bot/install-cli.sh}"
4+
LOCAL_INSTALL_PATH="/opt/clawdbot-install.sh"
5+
LOCAL_CLI_INSTALL_PATH="/opt/clawdbot-install-cli.sh"
6+
if [[ -n "${CLAWDBOT_INSTALL_URL:-}" ]]; then
7+
INSTALL_URL="$CLAWDBOT_INSTALL_URL"
8+
elif [[ -f "$LOCAL_INSTALL_PATH" ]]; then
9+
INSTALL_URL="file://${LOCAL_INSTALL_PATH}"
10+
else
11+
INSTALL_URL="https://clawd.bot/install.sh"
12+
fi
13+
14+
if [[ -n "${CLAWDBOT_INSTALL_CLI_URL:-}" ]]; then
15+
CLI_INSTALL_URL="$CLAWDBOT_INSTALL_CLI_URL"
16+
elif [[ -f "$LOCAL_CLI_INSTALL_PATH" ]]; then
17+
CLI_INSTALL_URL="file://${LOCAL_CLI_INSTALL_PATH}"
18+
else
19+
CLI_INSTALL_URL="https://clawd.bot/install-cli.sh"
20+
fi
621

722
echo "==> Pre-flight: ensure git absent"
823
if command -v git >/dev/null; then
@@ -11,7 +26,7 @@ if command -v git >/dev/null; then
1126
fi
1227

1328
echo "==> Run installer (non-root user)"
14-
curl -fsSL "$INSTALL_URL" | bash --no-onboard
29+
curl -fsSL "$INSTALL_URL" | bash -s -- --no-onboard
1530

1631
# Ensure PATH picks up user npm prefix
1732
export PATH="$HOME/.npm-global/bin:$PATH"

scripts/docker/install-sh-smoke/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ RUN apt-get update \
99
sudo \
1010
&& rm -rf /var/lib/apt/lists/*
1111

12-
COPY run.sh /usr/local/bin/clawdbot-install-smoke
13-
RUN chmod +x /usr/local/bin/clawdbot-install-smoke
12+
COPY scripts/docker/install-sh-smoke/run.sh /usr/local/bin/clawdbot-install-smoke
13+
COPY public/install.sh /opt/clawdbot-install.sh
14+
RUN chmod +x /usr/local/bin/clawdbot-install-smoke \
15+
&& chmod a+r /opt/clawdbot-install.sh
1416

1517
ENTRYPOINT ["/usr/local/bin/clawdbot-install-smoke"]

scripts/docker/install-sh-smoke/run.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
INSTALL_URL="${CLAWDBOT_INSTALL_URL:-https://clawd.bot/install.sh}"
4+
LOCAL_INSTALL_PATH="/opt/clawdbot-install.sh"
5+
if [[ -n "${CLAWDBOT_INSTALL_URL:-}" ]]; then
6+
INSTALL_URL="$CLAWDBOT_INSTALL_URL"
7+
elif [[ -f "$LOCAL_INSTALL_PATH" ]]; then
8+
INSTALL_URL="file://${LOCAL_INSTALL_PATH}"
9+
else
10+
INSTALL_URL="https://clawd.bot/install.sh"
11+
fi
512

613
echo "==> Resolve npm versions"
714
LATEST_VERSION="$(npm view clawdbot version)"
@@ -23,7 +30,7 @@ echo "==> Preinstall previous (forces installer upgrade path)"
2330
npm install -g "clawdbot@${PREVIOUS_VERSION}"
2431

2532
echo "==> Run official installer one-liner"
26-
curl -fsSL "$INSTALL_URL" | bash --no-onboard
33+
curl -fsSL "$INSTALL_URL" | bash -s -- --no-onboard
2734

2835
echo "==> Verify installed version"
2936
INSTALLED_VERSION="$(clawdbot --version 2>/dev/null | head -n 1 | tr -d '\r')"

0 commit comments

Comments
 (0)