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/
|
.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
|
hs-source-dirs: src
|
||||||
exposed-modules: Pattern, Field, Constraint, Helper
|
exposed-modules: Pattern, Field, Constraint, Helper
|
||||||
build-depends: base >= 4.7 && < 5
|
build-depends: base >= 4.7 && < 5
|
||||||
, dates == 0.2.2.1
|
, dates == 0.2.2.2
|
||||||
, text
|
, text
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ executable haskell-cron-matcher-exe
|
|||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Werror
|
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Werror
|
||||||
build-depends: base
|
build-depends: base
|
||||||
, dates == 0.2.2.1
|
, dates == 0.2.2.2
|
||||||
, parsec
|
, parsec
|
||||||
, haskell-cron-matcher
|
, haskell-cron-matcher
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
@ -37,7 +37,7 @@ test-suite haskell-cron-matcher-test
|
|||||||
main-is: Spec.hs
|
main-is: Spec.hs
|
||||||
other-modules: PatternSpec, FieldSpec, ConstraintSpec, HelperSpec
|
other-modules: PatternSpec, FieldSpec, ConstraintSpec, HelperSpec
|
||||||
build-depends: base
|
build-depends: base
|
||||||
, dates == 0.2.2.1
|
, dates == 0.2.2.2
|
||||||
, hspec
|
, hspec
|
||||||
, QuickCheck
|
, QuickCheck
|
||||||
, haskell-cron-matcher
|
, haskell-cron-matcher
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
# resolver:
|
# resolver:
|
||||||
# name: custom-snapshot
|
# name: custom-snapshot
|
||||||
# location: "./custom-snapshot.yaml"
|
# location: "./custom-snapshot.yaml"
|
||||||
resolver: lts-9.12
|
resolver: lts-12.26
|
||||||
|
|
||||||
# User packages to be built.
|
# User packages to be built.
|
||||||
# Various formats can be used as shown in the example below.
|
# 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
|
# non-dependency (i.e. a user package), and its test suites and benchmarks
|
||||||
# will not be run. This is useful for tweaking upstream packages.
|
# will not be run. This is useful for tweaking upstream packages.
|
||||||
packages:
|
packages:
|
||||||
- '.'
|
- '.'
|
||||||
|
|
||||||
# Dependency packages to be pulled from upstream that are not in the resolver
|
# Dependency packages to be pulled from upstream that are not in the resolver
|
||||||
# (e.g., acme-missiles-0.3)
|
# (e.g., acme-missiles-0.3)
|
||||||
extra-deps:
|
extra-deps:
|
||||||
- dates-0.2.2.1
|
- dates-0.2.2.2
|
||||||
|
|
||||||
# Override default flag values for local packages and extra-deps
|
# Override default flag values for local packages and extra-deps
|
||||||
flags: {}
|
flags: {}
|
||||||
|
Loading…
Reference in New Issue
Block a user