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