Permalink
Browse files

Use stack in docker

  • Loading branch information...
admire93 committed Jun 14, 2017
1 parent 4376501 commit baf63fdc571ca351570a53a7e9a05309668b18a1
Showing with 8 additions and 22 deletions.
  1. +4 −3 Dockerfile
  2. +0 −8 README.md
  3. +4 −11 lint.sh
View
@@ -4,15 +4,16 @@ MAINTAINER Minyoung Jeong <kkungkkung@gmail.com>
WORKDIR /opt/nirum
# Add just the .cabal file to capture dependencies
COPY ./nirum.cabal /opt/nirum/nirum.cabal
COPY ./package.yaml /opt/nirum/package.yaml
COPY ./stack.yaml /opt/nirum/stack.yaml
# Docker will cache this command as a layer, freeing us up to
# modify source code without re-installing dependencies
# (unless the .cabal file changes!)
RUN cabal update && cabal install --only-dependencies -j4
RUN stack build --only-snapshot
COPY . /opt/nirum
RUN cabal install
RUN stack build
ENV CMD=nirum
ENTRYPOINT ["./docker-entrypoint.sh"]
View
@@ -80,17 +80,9 @@ Using Haskell Stack:
$ stack build
Using vanilla Cabal:
$ cabal sandbox init
$ cabal install --only-dependencies
$ cabal configure
$ cabal build
You can run the test suite of Nirum:
$ stack test # using Hasekll Stack
$ cabal test # using Haskell Platform
$ ./lint.sh # run style lint as well
[5]: https://www.haskell.org/platform/
View
15 lint.sh
@@ -17,18 +17,11 @@ EOF
chmod +x .git/hooks/pre-commit
fi
if [[ "$(which stack)" != "" ]] && stack --help | head -n1 | grep -qi haskell
then
stack test hlint
if [[ "$(stack exec scan -- -v)" = "" ]]; then
stack install scan
fi
scan=(stack exec scan --)
else
cabal test hlint
cabal install scan
scan=(scan)
stack test hlint
if [[ "$(stack exec scan -- -v)" = "" ]]; then
stack install scan
fi
scan=(stack exec scan --)
# Haskell style scanner doesn't provide proper exit code ---
# it always exists with zero even if it found errors.

0 comments on commit baf63fd

Please sign in to comment.