mat.services/nix/deploy.nix

10 lines
323 B
Nix
Raw Normal View History

2022-08-27 19:08:42 +00:00
{ lib, docker, flyctl, formats, writeShellScriptBin, dockerImage }:
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}
image=$(docker load < $archive | awk '{ print $3; }')
flyctl deploy -i $image
''