1
0
mirror of https://github.com/akpall/akpella.git synced 2026-02-21 00:26:59 +00:00
Files
akpella/Makefile

30 lines
1.1 KiB
Makefile

config.json: config.yaml
docker run --rm -i \
quay.io/coreos/butane:latest \
--strict \
--pretty \
< config.yaml > config.json
.reset: config.json
-rm .reset
ssh -o ControlMaster=auto -o ControlPath=/tmp/ssh_mux_%h_%p_%r -o ControlPersist=10s -fN akpella && \
TEMPDIR=$$(ssh -o ControlPath=/tmp/ssh_mux_%h_%p_%r akpella "cd /tmp && mktemp -d") && \
scp -o ControlPath=/tmp/ssh_mux_%h_%p_%r config.json akpella:$${TEMPDIR} && \
ssh -o ControlPath=/tmp/ssh_mux_%h_%p_%r akpella \
sudo flatcar-reset \
--ignition-file $${TEMPDIR}/config.json \
--keep-machine-id \
--keep-paths '/etc/ssh/ssh_host_.*' '/opt/caddy/' '/opt/matrixdotorg-synapse/' /var/log && \
ssh -o ControlPath=/tmp/ssh_mux_%h_%p_%r akpella \
sudo systemctl reboot && \
ssh -o ControlPath=/tmp/ssh_mux_%h_%p_%r -O exit akpella;
touch .reset
reset: .reset
.PHONY: reset
update:
VER=$$(curl -fsSL https://stable.release.flatcar-linux.net/amd64-usr/current/version.txt | grep FLATCAR_VERSION= | cut -d = -f 2) && \
echo $${VER} && \
ssh akpella sudo flatcar-update -V $${VER} -A