mirror of
https://github.com/aelve/guide.git
synced 2024-11-22 20:01:36 +03:00
Use a different build image.
This commit is contained in:
commit
8370fcbee9
1
.gitignore
vendored
1
.gitignore
vendored
@ -33,3 +33,4 @@ tags
|
||||
|
||||
# JavaScript
|
||||
guidejs/node_modules/
|
||||
static/js/
|
||||
|
@ -9,6 +9,7 @@ addons:
|
||||
- libgmp-dev
|
||||
# Selenium
|
||||
- xvfb
|
||||
chrome: stable
|
||||
|
||||
cache:
|
||||
directories:
|
||||
@ -28,7 +29,7 @@ before_install:
|
||||
- export PATH=$HOME/.local/bin:$PATH
|
||||
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
|
||||
|
||||
- wget http://chromedriver.storage.googleapis.com/2.9/chromedriver_linux64.zip
|
||||
- wget http://chromedriver.storage.googleapis.com/2.25/chromedriver_linux64.zip
|
||||
- unzip chromedriver_linux64.zip
|
||||
- chmod +x chromedriver
|
||||
- sudo mv -f chromedriver /usr/local/share/chromedriver
|
||||
@ -38,11 +39,12 @@ before_install:
|
||||
before_script:
|
||||
- sh -e /etc/init.d/xvfb start
|
||||
- export DISPLAY=:99.0
|
||||
- travis_retry wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar
|
||||
- java -jar selenium-server-standalone-2.53.1.jar 2> /dev/null &
|
||||
- travis_retry wget http://selenium-release.storage.googleapis.com/3.0/selenium-server-standalone-3.0.1.jar
|
||||
- java -jar selenium-server-standalone-3.0.1.jar 2> /dev/null &
|
||||
- sleep 15
|
||||
|
||||
script:
|
||||
- scripts/buildjs.sh
|
||||
- stack $ARGS --no-terminal --install-ghc build --test
|
||||
- scripts/test-official.sh $ARGS
|
||||
|
||||
|
@ -103,7 +103,7 @@ library
|
||||
, feed >= 0.3.11 && < 0.4
|
||||
, filemanip == 0.3.6.*
|
||||
, filepath
|
||||
, fmt == 0.2.*
|
||||
, fmt == 0.4.*
|
||||
, focus
|
||||
, friendly-time == 0.4.*
|
||||
, fsnotify == 0.2.*
|
||||
|
@ -314,13 +314,13 @@ guideApp waiMetrics = do
|
||||
|
||||
-- plain "/auth" logs out a logged-in user and lets a logged-out user
|
||||
-- log in (this is not the best idea, granted, and we should just
|
||||
-- shot logged-in users a “logout” link and logged-out users a
|
||||
-- show logged-in users a “logout” link and logged-out users a
|
||||
-- “login” link instead)
|
||||
Spock.get (authRoute <//> root) $ do
|
||||
user <- getLoggedInUser
|
||||
if isJust user
|
||||
then Spock.redirect "auth/logout"
|
||||
else Spock.redirect "auth/login"
|
||||
then Spock.redirect "/auth/logout"
|
||||
else Spock.redirect "/auth/login"
|
||||
Spock.getpost (authRoute <//> "login") $ authRedirect "/" loginAction
|
||||
Spock.get (authRoute <//> "logout") logoutAction
|
||||
Spock.getpost (authRoute <//> "register") $ authRedirect "/" signupAction
|
||||
|
@ -1,21 +1,25 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
|
||||
module Guide.Routes
|
||||
( addRoute
|
||||
, adminRoute
|
||||
, authRoute
|
||||
, deleteRoute
|
||||
, haskellRoute
|
||||
, feedRoute
|
||||
, moveRoute
|
||||
, renderRoute
|
||||
, setRoute
|
||||
) where
|
||||
|
||||
import Web.Spock (Path)
|
||||
module Guide.Routes
|
||||
(
|
||||
addRoute,
|
||||
adminRoute,
|
||||
authRoute,
|
||||
deleteRoute,
|
||||
haskellRoute,
|
||||
feedRoute,
|
||||
moveRoute,
|
||||
renderRoute,
|
||||
setRoute,
|
||||
) where
|
||||
|
||||
|
||||
import Web.Spock (Path, (<//>))
|
||||
import Web.Routing.Combinators (PathState(Open))
|
||||
|
||||
|
||||
haskellRoute :: Path '[] 'Open
|
||||
haskellRoute = "haskell"
|
||||
|
||||
@ -23,22 +27,22 @@ authRoute :: Path '[] 'Open
|
||||
authRoute = "auth"
|
||||
|
||||
setRoute :: Path '[] 'Open
|
||||
setRoute = "set"
|
||||
setRoute = haskellRoute <//> "set"
|
||||
|
||||
addRoute :: Path '[] 'Open
|
||||
addRoute = "add"
|
||||
addRoute = haskellRoute <//> "add"
|
||||
|
||||
moveRoute :: Path '[] 'Open
|
||||
moveRoute = "move"
|
||||
moveRoute = haskellRoute <//> "move"
|
||||
|
||||
deleteRoute :: Path '[] 'Open
|
||||
deleteRoute = "delete"
|
||||
deleteRoute = haskellRoute <//> "delete"
|
||||
|
||||
feedRoute :: Path '[] 'Open
|
||||
feedRoute = "feed"
|
||||
feedRoute = haskellRoute <//> "feed"
|
||||
|
||||
renderRoute :: Path '[] 'Open
|
||||
renderRoute = "render"
|
||||
renderRoute = haskellRoute <//> "render"
|
||||
|
||||
adminRoute :: Path '[] 'Open
|
||||
adminRoute = "admin"
|
||||
|
@ -8,15 +8,7 @@ the "Prelude".)
|
||||
module Imports
|
||||
(
|
||||
module X,
|
||||
LByteString,
|
||||
(+|),
|
||||
(|+),
|
||||
(+||),
|
||||
(||+),
|
||||
(|++|),
|
||||
(||++||),
|
||||
(|++||),
|
||||
(||++|)
|
||||
LByteString
|
||||
)
|
||||
where
|
||||
|
||||
@ -48,44 +40,8 @@ import Data.Hashable as X
|
||||
-- Lazy bytestring
|
||||
import qualified Data.ByteString.Lazy as BSL
|
||||
-- Formatting
|
||||
import Fmt as X hiding (( #| ), ( #|| ), (|#), (|##|),
|
||||
(|##||), (||#), (||##|), (||##||))
|
||||
import qualified Fmt as FMT (( #| ), ( #|| ), (|#), (|##|), (|##||),
|
||||
(||#), (||##|), (||##||))
|
||||
import Fmt.Internal (FromBuilder)
|
||||
import Fmt as X
|
||||
|
||||
|
||||
type LByteString = BSL.ByteString
|
||||
-- LText is already provided by Data.Text.All
|
||||
|
||||
infixr 1 +|
|
||||
(+|) :: FromBuilder b => Builder -> Builder -> b
|
||||
(+|) = (FMT.#|)
|
||||
|
||||
infixr 1 |+
|
||||
(|+) :: (Buildable a, FromBuilder b) => a -> Builder -> b
|
||||
(|+) = (FMT.|#)
|
||||
|
||||
infixr 1 +||
|
||||
(+||) :: FromBuilder b => Builder -> Builder -> b
|
||||
(+||) = (FMT.#||)
|
||||
|
||||
infixr 1 ||+
|
||||
(||+) :: (Show a, FromBuilder b) => a -> Builder -> b
|
||||
(||+) = (FMT.||#)
|
||||
|
||||
infixr 1 |++|
|
||||
(|++|) :: (Buildable a, FromBuilder b) => a -> Builder -> b
|
||||
(|++|) = (FMT.|##|)
|
||||
|
||||
infixr 1 ||++||
|
||||
(||++||) :: (Show a, FromBuilder b) => a -> Builder -> b
|
||||
(||++||) = (FMT.||##||)
|
||||
|
||||
infixr 1 ||++|
|
||||
(|++||) :: (Show a, FromBuilder b) => a -> Builder -> b
|
||||
(|++||) = (FMT.|##||)
|
||||
|
||||
infixr 1 |++||
|
||||
(||++|) :: (Buildable a, FromBuilder b) => a -> Builder -> b
|
||||
(||++|) = (FMT.||##|)
|
||||
|
@ -15,6 +15,6 @@ extra-deps:
|
||||
- text-all-0.4.1.0
|
||||
- cmark-sections-0.1.0.3
|
||||
- patches-vector-0.1.5.4
|
||||
- fmt-0.2.0.0
|
||||
- fmt-0.4.0.0
|
||||
- Spock-digestive-0.3.0.0
|
||||
- digestive-functors-0.8.2.0
|
||||
|
Loading…
Reference in New Issue
Block a user