| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
EARTH ?= claude@earth |
| 6 |
SSH ?= ssh -i $(HOME)/.ssh/earth_claude |
| 7 |
SCP ?= scp -i $(HOME)/.ssh/earth_claude |
| 8 |
FLOW_HOME_ON_EARTH ?= /home/claude/flow |
| 9 |
INIT := target/x86_64-unknown-linux-gnu/release/flow-init |
| 10 |
|
| 11 |
.PHONY: build deploy-runner |
| 12 |
|
| 13 |
build: |
| 14 |
OXY_BUILD="$$(oxy --plain describe 2>/dev/null)" cargo build --release -p flow |
| 15 |
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release -p flow-init --target x86_64-unknown-linux-gnu |
| 16 |
|
| 17 |
deploy-runner: build |
| 18 |
$(SCP) target/release/flow $(EARTH):$(FLOW_HOME_ON_EARTH)/bin/flow.new |
| 19 |
$(SCP) $(INIT) $(EARTH):$(FLOW_HOME_ON_EARTH)/bin/flow-init.new |
| 20 |
$(SSH) $(EARTH) 'set -e; cd $(FLOW_HOME_ON_EARTH); \ |
| 21 |
cp -p bin/flow bin/flow.prev; cp -p bin/flow-init bin/flow-init.prev; cp -p flow.toml flow.toml.prev; \ |
| 22 |
mv bin/flow.new bin/flow; mv bin/flow-init.new bin/flow-init; \ |
| 23 |
h=$$(bin/flow hash bin/flow-init | cut -d" " -f1); \ |
| 24 |
sed -i "s|^init = .*|init = { path = \"bin/flow-init\", blake3 = \"$$h\" }|" flow.toml; \ |
| 25 |
sudo systemctl restart --no-block flow-runner; echo "flow-runner: restarting (it drains: the job it holds finishes first)"' |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
.PHONY: pins |
| 30 |
pins: |
| 31 |
cd deps/oxygen && oxy --plain pull origin && oxy --plain checkout |