From 8185eec5f100c6f8440d27952e26127a161d9faf Mon Sep 17 00:00:00 2001 From: Dhananjay Balan Date: Sun, 4 Mar 2018 22:56:07 +0100 Subject: [PATCH] Updated stack and moved to stack stack setup stack build stack exec site build for building the project. --- .gitlab-ci.yml | 16 ++++++++++------ blogng.cabal | 2 +- site.hs | 4 ++-- stack.yaml | 15 +++++++-------- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index afa4712..bc74f9e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,10 @@ -image: dmp1ce/hakyll:latest +image: fpco/stack-build + +test: + script: + - stack setup + - stack build + - stack exec site build deploy: before_script: @@ -15,12 +21,10 @@ deploy: - mkdir -p ~/.ssh - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - - cabal update - - cabal install regex-compat + - stack setup script: - - cabal build - - cabal run clean - - cabal run build + - stack build + - stack exec site build - scp -r public root@dbalan.in:/usr/local/www/blog/ only: - master diff --git a/blogng.cabal b/blogng.cabal index f46b557..677938f 100644 --- a/blogng.cabal +++ b/blogng.cabal @@ -6,7 +6,7 @@ cabal-version: >= 1.10 executable site main-is: site.hs build-depends: base == 4.* - , hakyll == 4.9.* + , hakyll >= 4.10.0 , filepath >= 1.4 , regex-compat ghc-options: -threaded diff --git a/site.hs b/site.hs index ff17925..b36df87 100644 --- a/site.hs +++ b/site.hs @@ -35,8 +35,8 @@ main = hakyllWith config $ do compile copyFileCompiler match "notes/*" $ do - route $ idRoute - compile copyFileCompiler + route $ idRoute + compile copyFileCompiler match "blog/*" $ do route $ octopressRoute diff --git a/stack.yaml b/stack.yaml index a1efa8b..2c1ed0d 100644 --- a/stack.yaml +++ b/stack.yaml @@ -2,7 +2,7 @@ # # Some commonly used options have been documented as comments in this file. # For advanced use and comprehensive documentation of the format, please see: -# http://docs.haskellstack.org/en/stable/yaml_configuration/ +# https://docs.haskellstack.org/en/stable/yaml_configuration/ # Resolver to choose a 'specific' stackage snapshot or a compiler version. # A snapshot resolver dictates the compiler version and the set of packages @@ -15,7 +15,7 @@ # resolver: # name: custom-snapshot # location: "./custom-snapshot.yaml" -resolver: nightly-2016-10-31 +resolver: lts-10.8 # User packages to be built. # Various formats can be used as shown in the example below. @@ -36,24 +36,23 @@ resolver: nightly-2016-10-31 # 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: -- '.' -- '../../public/hakyll' +- . # Dependency packages to be pulled from upstream that are not in the resolver # (e.g., acme-missiles-0.3) -extra-deps: [] +# extra-deps: [] # Override default flag values for local packages and extra-deps -flags: {} +# flags: {} # Extra package databases containing global packages -extra-package-dbs: [] +# extra-package-dbs: [] # Control whether we use the GHC we find on the path # system-ghc: true # # Require a specific version of stack, using version ranges # require-stack-version: -any # Default -# require-stack-version: ">=1.3" +# require-stack-version: ">=1.6" # # Override the architecture used by stack, especially useful on Windows # arch: i386