Compare commits
5
Commits
4a6e3b2454
..
v0.0.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c38574e005 | ||
|
|
700d53fbb0 | ||
|
|
c5c11ed181 | ||
|
|
36c9b880a7 | ||
|
|
c25ead672b |
@@ -41,8 +41,10 @@ By setting `$BASE_DIR` you can persist the database for later runs.
|
||||
|
||||
## TODO
|
||||
|
||||
- CI
|
||||
- Docker container (in flake)
|
||||
- try fourmolu
|
||||
- Test leap second handling in the `time` package
|
||||
- use queue to sync logging of indexer and main thread
|
||||
- [x] CI
|
||||
- [x] Docker container (in flake)
|
||||
- [x] try fourmolu
|
||||
- [x] Test leap second handling in the `time` package
|
||||
- [ ] Fix container shutdown delay
|
||||
- [ ] Fix `responseFile` always returning 200
|
||||
- [ ] use queue to sync logging of indexer and main thread
|
||||
|
||||
@@ -65,6 +65,7 @@ import Data.Time.Clock.POSIX (getPOSIXTime)
|
||||
import qualified Envy
|
||||
import qualified Yore.DB as DB
|
||||
import qualified Yore.Log as Log
|
||||
import System.IO (hSetBuffering, BufferMode (..), stdout)
|
||||
|
||||
data ConfigT f = Config
|
||||
{ yorePort :: f =@@ Int ? 3000
|
||||
@@ -79,6 +80,8 @@ deriving instance Show Config
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
hSetBuffering stdout NoBuffering
|
||||
|
||||
cfg <-
|
||||
Envy.load @ConfigT >>= \case
|
||||
Left errs -> do
|
||||
|
||||
@@ -63,8 +63,25 @@
|
||||
pkgs.dockerTools.buildImage {
|
||||
name = "git.pbrinkmeier.de/paul/yore";
|
||||
tag = yore.version;
|
||||
config.Cmd = [ "${yore}/bin/yore" ];
|
||||
copyToRoot = [ pkgs.cacert ];
|
||||
config.Cmd = [ "${entrypoint}/bin/run" ];
|
||||
};
|
||||
|
||||
entrypoint = pkgs.writeShellApplication {
|
||||
name = "run";
|
||||
runtimeInputs = [ pkgs.coreutils pkgs.dbmate yore ];
|
||||
text = ''
|
||||
set -Eeuo pipefail
|
||||
|
||||
mkdir -p /workspace/db
|
||||
cp -r ${./db}/* /workspace/db
|
||||
cd /workspace
|
||||
dbmate up
|
||||
|
||||
# Replace bash and inherit PID 1
|
||||
exec yore
|
||||
'';
|
||||
};
|
||||
in {
|
||||
packages = rec {
|
||||
default = yore;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
cabal-version: 3.4
|
||||
|
||||
name: yore
|
||||
version: 0.0.1
|
||||
version: 0.0.4
|
||||
author: Paul Brinkmeier
|
||||
maintainer: hallo@pbrinkmeier.de
|
||||
copyright: 2023 Paul Brinkmeier
|
||||
|
||||
Reference in New Issue
Block a user