Mercurial > code > home > repos > infra
comparison pi-watchdog/tasks.py @ 332:d4893670f888 default tip
WIP: use watchdog reboot timer on pi
author | drewp@bigasterisk.com |
---|---|
date | Thu, 27 Feb 2025 11:09:29 -0800 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
331:50a8b6c39b38 | 332:d4893670f888 |
---|---|
1 import datetime | |
2 | |
3 from invoke import task | |
4 | |
5 # todo- see https://github.com/GoogleContainerTools/skaffold/issues/9543 for one obstacle | |
6 | |
7 now = datetime.datetime.now().replace(microsecond=0) | |
8 now = now.isoformat().replace(':', '_').replace('-', '_') | |
9 base = 'pi_watchdog' | |
10 localImage = f'{base}:{now}' | |
11 remoteImage = f'reg:5000/{base}:latest' | |
12 | |
13 | |
14 @task | |
15 def build(ctx): # workaround for skaffold build | |
16 ctx.run(f'podman manifest create {localImage}', echo=True) | |
17 ctx.run(f'podman build --platform linux/arm64 --manifest {localImage} -f Dockerfile .', echo=True) | |
18 ctx.run(f'podman manifest push {localImage} {remoteImage}', echo=True) | |
19 print(f'{remoteImage} ready for use') | |
20 | |
21 | |
22 @task(pre=[build]) | |
23 def run(ctx): | |
24 ctx.run('kubectl apply -f deploy.yaml', echo=True) |