Skip to content

Commit 1a91b0c

Browse files
sragssclaude
andauthored
chore: switch deploy pipeline to fork-based flow
Replace the old deploy (npm install + sed patches + restart) with: - Build OpenClaw from Merit-Systems/openclaw fork at pinned commit - Render config via jq merge (repo config + EC2 secrets) - Sync credential scripts and systemd overrides from repo - Restart Both sed patches (billing error + compaction notify) are now proper commits on the fork, so the patch scripts are removed. Update openclaw-pin to 4e0e1a2 (includes compaction notify feature). Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4adf3c5 commit 1a91b0c

File tree

5 files changed

+40
-146
lines changed

5 files changed

+40
-146
lines changed

.github/workflows/deploy.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,47 @@ jobs:
1414
host: ${{ secrets.EC2_HOST }}
1515
username: ubuntu
1616
key: ${{ secrets.EC2_SSH_KEY }}
17+
command_timeout: 10m
1718
script: |
19+
set -euo pipefail
20+
export PATH="/home/ubuntu/.npm-global/bin:$PATH"
21+
1822
cd ~/Code/merit-systems/CraigClaw
1923
git pull origin main
20-
bash deploy/patch-openclaw.sh
21-
bash deploy/patch-compaction-notify.sh
24+
25+
# 1. Update OpenClaw if pin changed
26+
OPENCLAW_DIR=~/Code/openclaw/openclaw
27+
PIN=$(cat deploy/openclaw-pin | tr -d '[:space:]')
28+
CURRENT=$(cd $OPENCLAW_DIR && git rev-parse --short HEAD)
29+
if [ "$PIN" != "$CURRENT" ]; then
30+
echo "OpenClaw pin changed: $CURRENT -> $PIN"
31+
cd $OPENCLAW_DIR
32+
git fetch origin
33+
git checkout $PIN
34+
pnpm install --frozen-lockfile
35+
pnpm build
36+
npm install -g .
37+
cd ~/Code/merit-systems/CraigClaw
38+
else
39+
echo "OpenClaw pin unchanged ($CURRENT)"
40+
fi
41+
42+
# 2. Render config (repo base + EC2 secrets)
43+
jq -s '.[0] * .[1]' deploy/openclaw.json ~/.openclaw/secrets.json \
44+
> ~/.openclaw/openclaw.json
45+
46+
# 3. Sync credential scripts
47+
cp deploy/craig/get-github-token.sh ~/.config/craig/
48+
cp deploy/craig/git-credential-helper.sh ~/.config/craig/
49+
cp deploy/craig/start-openclaw.sh ~/.config/craig/
50+
chmod +x ~/.config/craig/*.sh
51+
52+
# 4. Sync systemd override
53+
mkdir -p ~/.config/systemd/user/openclaw-gateway.service.d
54+
cp deploy/craig/github.conf \
55+
~/.config/systemd/user/openclaw-gateway.service.d/
56+
systemctl --user daemon-reload
57+
58+
# 5. Restart
2259
systemctl --user restart openclaw-gateway
2360
echo "Deployed $(git log --oneline -1)"

deploy/openclaw-pin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0ada807
1+
4e0e1a2

deploy/openclaw.json.template

Lines changed: 0 additions & 43 deletions
This file was deleted.

deploy/patch-compaction-notify.sh

Lines changed: 0 additions & 63 deletions
This file was deleted.

deploy/patch-openclaw.sh

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)