From f77d88887440995394e794985961a2600a46ec2b Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 15 Jun 2022 17:19:31 -0700 Subject: 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 --- tools/govanity/default.nix | 16 +++++++++++----- tools/govanity/scripts/deploy.sh | 8 -------- 2 files changed, 11 insertions(+), 13 deletions(-) delete mode 100755 tools/govanity/scripts/deploy.sh (limited to 'tools') 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 -- cgit 1.4.1