aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2026-02-10 02:55:48 +0000
committerPaul Oliver <contact@pauloliver.dev>2026-02-10 02:55:48 +0000
commit39c4a5f7ad2a7cffe5227d20ed7485845911c905 (patch)
tree3231d32e3c90ff3740a1793b61319c7091f3b34e
parente7143436a334f364a6ae8866eb3fb31a259ff90c (diff)
Adds deployment support
-rw-r--r--Makefile8
-rw-r--r--hsm-drive/hsm-drive.cabal2
-rw-r--r--hsm-ina226/hsm-ina226.cabal2
-rw-r--r--hsm-repl/hsm-repl.cabal2
-rw-r--r--hsm-stream/hsm-stream.cabal2
-rw-r--r--hsm-web/Hsm/Web.hs3
6 files changed, 12 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 6a9d963..ce383e9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,3 @@
-resolver = $(shell curl -s https://www.stackage.org/download/snapshots.json | yq .lts)
-packages = $(shell ls -dQm hsm-*)
client_dir = hsm-web/Client
build:
@@ -12,7 +10,11 @@ clean:
update:
cd $(client_dir) && npm update
- yq -i '.resolver="$(resolver)" | .packages=[$(packages)]' stack.yaml
+ yq -i '.resolver="$(shell curl -s https://www.stackage.org/download/snapshots.json | yq .lts)" | .packages=[$(shell ls -dQm hsm-*)]' stack.yaml
+
+deploy:
+ rsync -rv --mkpath --delete $(shell find .stack-work -type d -name bin) hsmouse:~/.local/
+ rsync -rv --mkpath --delete $(client_dir)/dist/ hsmouse:~/Client/dist/
watch:
cd $(client_dir) && npm run serve
diff --git a/hsm-drive/hsm-drive.cabal b/hsm-drive/hsm-drive.cabal
index 0443dda..66fd288 100644
--- a/hsm-drive/hsm-drive.cabal
+++ b/hsm-drive/hsm-drive.cabal
@@ -18,7 +18,7 @@ library
-O2 -Wall -Werror -Wno-star-is-type -Wunused-packages
-fplugin=Effectful.Plugin
-executable test-drive
+executable hsm-test-drive
build-depends:
, base
, echo
diff --git a/hsm-ina226/hsm-ina226.cabal b/hsm-ina226/hsm-ina226.cabal
index ce831d1..01af11d 100644
--- a/hsm-ina226/hsm-ina226.cabal
+++ b/hsm-ina226/hsm-ina226.cabal
@@ -19,7 +19,7 @@ library
-O2 -Wall -Werror -Wno-star-is-type -Wunused-packages
-fplugin=Effectful.Plugin
-executable test-ina226
+executable hsm-test-ina226
build-depends:
, aeson
, base
diff --git a/hsm-repl/hsm-repl.cabal b/hsm-repl/hsm-repl.cabal
index 5d9a794..66625eb 100644
--- a/hsm-repl/hsm-repl.cabal
+++ b/hsm-repl/hsm-repl.cabal
@@ -20,7 +20,7 @@ library
-O2 -Wall -Werror -Wno-star-is-type -Wunused-packages
-fplugin=Effectful.Plugin
-executable test-repl
+executable hsm-test-repl
build-depends:
, base
, effectful-core
diff --git a/hsm-stream/hsm-stream.cabal b/hsm-stream/hsm-stream.cabal
index 1774ae7..6746bb8 100644
--- a/hsm-stream/hsm-stream.cabal
+++ b/hsm-stream/hsm-stream.cabal
@@ -19,7 +19,7 @@ library
-O2 -Wall -Werror -Wno-star-is-type -Wunused-packages
-fplugin=Effectful.Plugin
-executable test-stream
+executable hsm-test-stream
build-depends:
, base
, effectful
diff --git a/hsm-web/Hsm/Web.hs b/hsm-web/Hsm/Web.hs
index a99ba5b..79e007d 100644
--- a/hsm-web/Hsm/Web.hs
+++ b/hsm-web/Hsm/Web.hs
@@ -19,6 +19,7 @@ import Effectful.Dispatch.Static
, getStaticRep
, unEff
, unsafeEff
+ , unsafeEff_
)
import Effectful.Dispatch.Static.Primitive (Env)
import Effectful.Exception (finally)
@@ -109,8 +110,10 @@ runServer
runServer = finally startServer stopServer
where
startServer = do
+ dist <- unsafeEff_ $ getDataFileName "Client/dist/"
Web options <- getStaticRep
logMsg @"web" Info "Starting scotty web server"
+ logMsg @"web" Info $ "Serving static files from: " <> dist
unsafeEff $ server options
stopServer = logMsg @"web" Info "Stopping scotty web server"