Add docker for building
This commit is contained in:
parent
4be7709d9f
commit
c96cc544e4
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@ -0,0 +1 @@
|
||||
.stack-work/
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1,3 @@
|
||||
.local/
|
||||
.stack-work/
|
||||
*.sublime-*
|
||||
|
5
Dockerfile
Normal file
5
Dockerfile
Normal file
@ -0,0 +1,5 @@
|
||||
FROM fpco/stack-build:lts-13.10
|
||||
|
||||
# Code formatter
|
||||
# RUN stack --system-ghc --local-bin-path=/usr/local/bin install \
|
||||
# hfmt
|
37
Makefile
Normal file
37
Makefile
Normal file
@ -0,0 +1,37 @@
|
||||
app_name := haskell-cron-matcher
|
||||
image := ${app_name}-stack
|
||||
|
||||
container_work_dir := /app
|
||||
cache_dir := ${container_work_dir}/.stack-work
|
||||
|
||||
uid := $(shell id -u)
|
||||
gid := $(shell id -g)
|
||||
|
||||
stack := docker run \
|
||||
--rm \
|
||||
--tty \
|
||||
--init \
|
||||
--user "${uid}:${gid}" \
|
||||
--volume "${PWD}:${container_work_dir}" \
|
||||
--env "STACK_ROOT=${cache_dir}" \
|
||||
--workdir "${container_work_dir}" \
|
||||
${image}
|
||||
|
||||
# Targets
|
||||
|
||||
.PHONY: build-docker
|
||||
build-docker:
|
||||
docker build --tag=${image} .
|
||||
${stack} stack --system-ghc --local-bin-path=./.local install hindent hfmt
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
${stack} stack build
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
${stack} stack test
|
||||
|
||||
.PHONY: format
|
||||
format:
|
||||
${stack} .local/hfmt -w src/
|
@ -17,7 +17,7 @@ library
|
||||
hs-source-dirs: src
|
||||
exposed-modules: Pattern, Field, Constraint, Helper
|
||||
build-depends: base >= 4.7 && < 5
|
||||
, dates == 0.2.2.1
|
||||
, dates == 0.2.2.2
|
||||
, text
|
||||
default-language: Haskell2010
|
||||
|
||||
@ -26,7 +26,7 @@ executable haskell-cron-matcher-exe
|
||||
main-is: Main.hs
|
||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Werror
|
||||
build-depends: base
|
||||
, dates == 0.2.2.1
|
||||
, dates == 0.2.2.2
|
||||
, parsec
|
||||
, haskell-cron-matcher
|
||||
default-language: Haskell2010
|
||||
@ -37,7 +37,7 @@ test-suite haskell-cron-matcher-test
|
||||
main-is: Spec.hs
|
||||
other-modules: PatternSpec, FieldSpec, ConstraintSpec, HelperSpec
|
||||
build-depends: base
|
||||
, dates == 0.2.2.1
|
||||
, dates == 0.2.2.2
|
||||
, hspec
|
||||
, QuickCheck
|
||||
, haskell-cron-matcher
|
||||
|
@ -15,7 +15,7 @@
|
||||
# resolver:
|
||||
# name: custom-snapshot
|
||||
# location: "./custom-snapshot.yaml"
|
||||
resolver: lts-9.12
|
||||
resolver: lts-12.26
|
||||
|
||||
# User packages to be built.
|
||||
# Various formats can be used as shown in the example below.
|
||||
@ -36,11 +36,12 @@ resolver: lts-9.12
|
||||
# non-dependency (i.e. a user package), and its test suites and benchmarks
|
||||
# will not be run. This is useful for tweaking upstream packages.
|
||||
packages:
|
||||
- '.'
|
||||
- '.'
|
||||
|
||||
# Dependency packages to be pulled from upstream that are not in the resolver
|
||||
# (e.g., acme-missiles-0.3)
|
||||
extra-deps:
|
||||
- dates-0.2.2.1
|
||||
extra-deps:
|
||||
- dates-0.2.2.2
|
||||
|
||||
# Override default flag values for local packages and extra-deps
|
||||
flags: {}
|
||||
|
Loading…
Reference in New Issue
Block a user