build haskal
This commit is contained in:
parent
f1a25c6d3f
commit
bc45ec5fe0
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
matabas-db/
|
||||
artifacts/
|
14
buildScripts/build.sh
Executable file
14
buildScripts/build.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
set -e
|
||||
|
||||
mkdir -p artifacts
|
||||
|
||||
log "Kompilerar backend..."
|
||||
find backend -type f -and -name '*.hs' -print0 \
|
||||
| xargs -0 ghc -o artifacts/Main \
|
||||
-odir artifacts \
|
||||
-hidir artifacts \
|
||||
-tmpdir artifacts
|
||||
|
||||
log "Klar" "!"
|
||||
|
||||
set +e
|
|
@ -35,6 +35,16 @@ createdb -p "$PGPORT" matabas 2>>./matabas-db/matabas.log || log "Matabasen finn
|
|||
log "Ställer in schema.sql"
|
||||
psql -p "$PGPORT" "$PBDATABASE" < schema.sql
|
||||
|
||||
P="$PWD"
|
||||
clean() {
|
||||
log "Rensar byggnad"
|
||||
rm -rf artifacts
|
||||
}
|
||||
|
||||
build() {
|
||||
source "$P/buildScripts/build.sh"
|
||||
}
|
||||
|
||||
log "Redo" "!"
|
||||
|
||||
set +e
|
|
@ -14,8 +14,12 @@
|
|||
default = pkgs.hello;
|
||||
};
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [ packages.default pkgs.postgresql_15_jit pkgs.cargo ];
|
||||
shellHook = builtins.readFile ./build/devShellHook.sh ;
|
||||
packages = [
|
||||
packages.default
|
||||
pkgs.postgresql_15_jit
|
||||
( pkgs.ghc.withPackages (ps: with ps; [ scotty postgresql-typed ]) )
|
||||
];
|
||||
shellHook = builtins.readFile ./buildScripts/devShellHook.sh ;
|
||||
};
|
||||
}
|
||||
) // {
|
||||
|
|
Loading…
Reference in New Issue
Block a user