2017-02-18 19:25:57 +00:00
|
|
|
module System.Serverman ( run
|
|
|
|
, module System.Serverman.Action
|
|
|
|
, module System.Serverman.Utils
|
|
|
|
, module System.Serverman.Services
|
|
|
|
, module System.Serverman.Actions.WebServer
|
2017-02-19 12:47:37 +00:00
|
|
|
, module System.Serverman.Actions.Database
|
2017-02-18 19:25:57 +00:00
|
|
|
, module System.Serverman.Actions.Env
|
|
|
|
, module System.Serverman.Actions.Install) where
|
|
|
|
|
|
|
|
import System.Serverman.Action
|
|
|
|
import System.Serverman.Utils
|
|
|
|
import System.Serverman.Services
|
2017-02-19 12:47:37 +00:00
|
|
|
|
2017-02-18 19:25:57 +00:00
|
|
|
import System.Serverman.Actions.Install
|
|
|
|
import System.Serverman.Actions.Env
|
|
|
|
|
|
|
|
import System.Serverman.Actions.WebServer
|
2017-02-19 12:47:37 +00:00
|
|
|
import System.Serverman.Actions.Nginx
|
|
|
|
|
|
|
|
import System.Serverman.Actions.Database
|
|
|
|
import System.Serverman.Actions.MySQL
|
2017-02-18 19:25:57 +00:00
|
|
|
|
|
|
|
import Control.Monad.Free
|
|
|
|
|
|
|
|
run :: Action r -> IO r
|
|
|
|
run (Pure r) = return r
|
|
|
|
run (Free (NewWebServer params next))
|
2017-02-19 12:47:37 +00:00
|
|
|
| serverService params == NGINX = nginx params >> run next
|
2017-02-18 19:25:57 +00:00
|
|
|
| otherwise = run next
|
|
|
|
run (Free (DetectOS next)) = getOS >>= run . next
|
|
|
|
run (Free (Install os service next)) = installService os service >> run next
|
2017-02-19 12:47:37 +00:00
|
|
|
run (Free (NewDatabase params next))
|
|
|
|
| databaseService params == MySQL = mysql params >> run next
|
|
|
|
| otherwise = run next
|
2017-02-18 19:25:57 +00:00
|
|
|
|