module B9.Docker
( Docker (..),
)
where
import B9.B9Config
( dockerConfigs,
getB9Config,
)
import B9.B9Config.Docker as X
import B9.Container
import B9.DiskImages
import B9.ShellScript
import Control.Lens (view)
newtype Docker = Docker DockerConfig
instance Backend Docker where
getBackendConfig :: proxy Docker -> Eff e (Maybe Docker)
getBackendConfig proxy Docker
_ =
(DockerConfig -> Docker) -> Maybe DockerConfig -> Maybe Docker
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap DockerConfig -> Docker
Docker (Maybe DockerConfig -> Maybe Docker)
-> (B9Config -> Maybe DockerConfig) -> B9Config -> Maybe Docker
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Getting (Maybe DockerConfig) B9Config (Maybe DockerConfig)
-> B9Config -> Maybe DockerConfig
forall s (m :: * -> *) a. MonadReader s m => Getting a s a -> m a
view Getting (Maybe DockerConfig) B9Config (Maybe DockerConfig)
Lens' B9Config (Maybe DockerConfig)
dockerConfigs (B9Config -> Maybe Docker)
-> Eff e B9Config -> Eff e (Maybe Docker)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Eff e B9Config
forall (e :: [* -> *]). Member B9ConfigReader e => Eff e B9Config
getB9Config
supportedImageTypes :: proxy Docker -> [ImageType]
supportedImageTypes proxy Docker
_ = [ImageType
Raw]
runInEnvironment :: Docker -> ExecEnv -> Script -> Eff e Bool
runInEnvironment (Docker DockerConfig
_dcfg) ExecEnv
_env Script
scriptIn = do
if Script -> Bool
emptyScript Script
scriptIn
then Bool -> Eff e Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
True
else do [Char] -> Eff e Bool
forall a. HasCallStack => [Char] -> a
error [Char]
"TODO"