From 082b5f7409c42212f34901bb4f796a8d816e5364 Mon Sep 17 00:00:00 2001 From: sabadev Date: Mon, 15 Mar 2021 18:19:53 -0400 Subject: [PATCH] Added dependencies and some helper provision scripts. --- Vagrantfile | 20 +++++++++++++++++++- package.yaml | 23 ++++++++++++++++++++++- stack.yaml.lock | 13 +++++++++++++ website.cabal | 37 ++++++++++++++++++++++++++++++++----- 4 files changed, 86 insertions(+), 7 deletions(-) create mode 100644 stack.yaml.lock diff --git a/Vagrantfile b/Vagrantfile index 6e90300..eec7552 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,8 +4,23 @@ sudo apt-get install -y nginx certbot python-certbot-nginx stack --version || wget -qO- https://get.haskellstack.org/ | sh SCRIPT +$build = <<-SCRIPT +cd /vagrant +sudo stack --allow-different-user build +SCRIPT + +$test = <<-SCRIPT +cd /vagrant +sudo stack --allow-different-user test +SCRIPT + +$run = <<-SCRIPT +cd /vagrant +sudo stack --allow-different-user exec website +SCRIPT + Vagrant.configure("2") do |config| - config.vm.box = "generic/debian10" + config.vm.box = "debian/buster64" config.vm.provider "virtualbox" do |vb| vb.gui = false @@ -18,4 +33,7 @@ Vagrant.configure("2") do |config| config.vm.network "forwarded_port", guest: 80, host: 7000 config.vm.provision "shell", inline: $script + config.vm.provision "build", type: "shell", run: "never", inline: $build + config.vm.provision "test", type: "shell", run: "never", inline: $test + config.vm.provision "run", type: "shell", run: "never", inline: $run end diff --git a/package.yaml b/package.yaml index 379c79d..fb2140c 100644 --- a/package.yaml +++ b/package.yaml @@ -20,13 +20,32 @@ extra-source-files: description: Please see the README on GitHub at dependencies: +- aeson == 1.5.6.0 - base >= 4.7 && < 5 +- bytestring == 0.10.12.0 +- cmark == 0.6 +- containers == 0.6.2.1 +- mtl == 2.2.2 +- servant == 0.18.2 +- servant-server == 0.18.2 +- text == 1.2.4.1 +- warp == 3.3.14 + +default-extensions: +- DataKinds +- FlexibleContexts +- FlexibleInstances +- GADTs +- KindSignatures +- OverloadedStrings +- StandaloneDeriving +- TypeOperators library: source-dirs: src executables: - website-exe: + website: main: Main.hs source-dirs: app ghc-options: @@ -46,3 +65,5 @@ tests: - -with-rtsopts=-N dependencies: - website + - hspec == 2.7.8 + - QuickCheck == 2.14.2 diff --git a/stack.yaml.lock b/stack.yaml.lock new file mode 100644 index 0000000..939ffa9 --- /dev/null +++ b/stack.yaml.lock @@ -0,0 +1,13 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: [] +snapshots: +- completed: + size: 565712 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/17/6.yaml + sha256: 4e5e581a709c88e3fe26a9ce8bf331435729bead762fb5c190064c6c5bb1b835 + original: + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/17/6.yaml diff --git a/website.cabal b/website.cabal index 9e695b5..2166596 100644 --- a/website.cabal +++ b/website.cabal @@ -4,7 +4,7 @@ cabal-version: 1.12 -- -- see: https://github.com/sol/hpack -- --- hash: d1ec5dfa4cc510cab138672ec3fb62adf28f1c0201375eda36d389cdd1377686 +-- hash: 5b56f25d1b124af245aaaa6eec2b43613e0fdc60999133b89b5d229692d84c2d name: website version: 0.1.0.0 @@ -33,10 +33,19 @@ library hs-source-dirs: src build-depends: - base >=4.7 && <5 + aeson ==1.5.6.0 + , base >=4.7 && <5 + , bytestring ==0.10.12.0 + , containers ==0.6.2.1 + , mtl ==2.2.2 + , pandoc ==2.11.4 + , servant ==0.18.2 + , servant-server ==0.18.2 + , text ==1.2.4.1 + , warp ==3.3.14 default-language: Haskell2010 -executable website-exe +executable website main-is: Main.hs other-modules: Paths_website @@ -44,7 +53,16 @@ executable website-exe app ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: - base >=4.7 && <5 + aeson ==1.5.6.0 + , base >=4.7 && <5 + , bytestring ==0.10.12.0 + , containers ==0.6.2.1 + , mtl ==2.2.2 + , pandoc ==2.11.4 + , servant ==0.18.2 + , servant-server ==0.18.2 + , text ==1.2.4.1 + , warp ==3.3.14 , website default-language: Haskell2010 @@ -57,6 +75,15 @@ test-suite website-test test ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: - base >=4.7 && <5 + aeson ==1.5.6.0 + , base >=4.7 && <5 + , bytestring ==0.10.12.0 + , containers ==0.6.2.1 + , mtl ==2.2.2 + , pandoc ==2.11.4 + , servant ==0.18.2 + , servant-server ==0.18.2 + , text ==1.2.4.1 + , warp ==3.3.14 , website default-language: Haskell2010 -- 2.20.1