2022-08-27 19:08:42 +00:00
|
|
|
{ lib, docker, flyctl, formats, writeShellScriptBin, dockerImage }:
|
2022-08-27 03:54:29 +00:00
|
|
|
|
|
|
|
writeShellScriptBin "deploy" ''
|
|
|
|
set -euxo pipefail
|
|
|
|
export PATH="${lib.makeBinPath [(docker.override { clientOnly = true; }) flyctl]}:$PATH"
|
2022-08-27 19:08:42 +00:00
|
|
|
archive=${dockerImage}
|
2022-09-06 04:36:55 +00:00
|
|
|
# load archive, drop all output except last line (in case of warnings), print image name
|
|
|
|
image=$(docker load < $archive | tail -n1 | awk '{ print $3; }')
|
|
|
|
flyctl deploy --image $image --local-only
|
2022-08-27 03:54:29 +00:00
|
|
|
''
|