diff options
author | Franck Cuny <franck@fcuny.net> | 2022-06-15 17:19:31 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-06-15 17:48:01 -0700 |
commit | f77d88887440995394e794985961a2600a46ec2b (patch) | |
tree | 91fd816bd96caf33dd6485e9557544d70710ad25 /tools/govanity | |
parent | ref(home/go): update to go version 1.18, ensure gopls (diff) | |
download | world-f77d88887440995394e794985961a2600a46ec2b.tar.gz |
ref(tools/govanity): simplify the deployment script
No need for an external script, there's only a need to run the tests and deploy with `flyctl`. Change-Id: I05400f6b813573b26af884d784fe407d4435429f Reviewed-on: https://cl.fcuny.net/c/world/+/421 Tested-by: CI Reviewed-by: Franck Cuny <franck@fcuny.net>
Diffstat (limited to 'tools/govanity')
-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 |