diff options
-rw-r--r-- | tools/govanity/default.nix | 16 | ||||
-rwxr-xr-x | tools/govanity/scripts/deploy.sh | 8 |
2 files changed, 11 insertions, 13 deletions
diff --git a/tools/govanity/default.nix b/tools/govanity/default.nix index 10652ff..d0239a6 100644 --- a/tools/govanity/default.nix +++ b/tools/govanity/default.nix @@ -7,11 +7,17 @@ pkgs.buildGoModule rec { nativeBuildInputs = with pkgs; [ go ]; deploy = pkgs.pkgs.writeShellScriptBin "run-deploy" '' - set -euxo pipefail - export PATH=${ - pkgs.lib.makeBinPath [ pkgs.go pkgs.git pkgs.jq pkgs.flyctl ] - }:$PATH - bash ./scripts/deploy.sh + set -euo pipefail + export PATH=${pkgs.lib.makeBinPath [ pkgs.go pkgs.flyctl ]}:$PATH + + cd ${src} + + # run the tests, if they fail, we bail + echo "running tests ...." + ${pkgs.go}/bin/go test -v + + echo "deploying ...." + ${pkgs.flyctl}/bin/flyctl deploy ''; meta = with pkgs.lib; { diff --git a/tools/govanity/scripts/deploy.sh b/tools/govanity/scripts/deploy.sh deleted file mode 100755 index b088c7e..0000000 --- a/tools/govanity/scripts/deploy.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -git diff --exit-code -git diff --staged --exit-code - -flyctl deploy - -[[ "${CI}" ]] && flyctl agent stop |