serverman/src/System/Serverman.hs
Mahdi Dibaiee d86daa863d fix(install): don't show output of install to user
feat(mysql): add mysql as a service, only installation works right now,
there's no configuration
feat(execute): internal function to execute commands
2017-02-19 16:17:37 +03:30

36 lines
1.3 KiB
Haskell

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