From a759fc28f715f4c7523a830314e3ccf09e2f0d70 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sun, 8 May 2022 16:36:28 -0600 Subject: Add test target to Makefile to run full integration tests --- Makefile | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d074a3d..de7e4f1 100644 --- a/Makefile +++ b/Makefile @@ -1,34 +1,23 @@ -SKIP_SERVICES = [] -all: - nix-build -A entrypoint \ - --arg baseConfig '(import ./config.nix)' \ - --arg baseSkipServices '${SKIP_SERVICES}' - -run: all - ./result +CONFIG = ./config.nix -all.prod: +entrypoint: nix-build -A entrypoint \ - --arg baseConfig '(import ./prod.config.nix)' \ - --arg baseSkipServices '${SKIP_SERVICES}' + --arg baseConfig '(import ${CONFIG})' -run.prod: all.prod +install: + nix-build -A install --arg baseConfig '(import ${CONFIG})' ./result -install.prod: - nix-build -A install --arg baseConfig '(import ./prod.config.nix)' - ./result +test: + $$(nix-build --no-out-link -A pkgs.bash)/bin/bash test.sh + @if [ $$? == 0 ]; then echo "TESTS PASSED!"; else echo "TESTS FAILED!"; fi srv.shell: - nix-shell -A srv.shell --command 'cd srv; return' - -srv.shell.prod: - nix-shell -A srv.shell --arg baseConfig '(import ./prod.config.nix)' --command 'cd srv; return' - -static.shell: - nix-shell -A static.shell --command 'cd static; return' + nix-shell -A srv.shell --arg baseConfig '(import ${CONFIG})' \ + --command 'cd srv; return' +# TODO static is on the way out, these aren't well supported static.serve: nix-shell -A static.shell --run 'cd static; static-serve' -- cgit v1.2.3