deptrack-devops-0.1.0.0: DepTrack applied to DevOps.

Safe HaskellNone
LanguageHaskell2010

Devops.Cli

Contents

Description

Building-block methods to build a command-line tool able to inspect and turnup/turndown DevOps.

Synopsis

Documentation

Building main programs

simpleMain Source #

Arguments

:: DevOp env a

an operation

-> [Forest PreOp -> Forest PreOp]

forest transformations to optimize the resulting graph

-> [String]

args

-> env

environment

-> IO () 

Simple main function for a single operation.

You should use this simpleMain for simple configuration binaries, more involved architectures shoul almost need a App or appMain.

type SelfPath = FilePath Source #

A FilePath corresponding to the file with the currently-executing binary.

type ForestOptimization = Forest PreOp -> Forest PreOp Source #

An optimization on PreOp forests.

data App env node Source #

A builder for app that can be useful for defining an infrastructure as a recursive structure where the "main entry point" of the recursion is the binary itself.

Constructors

App 

Fields

appMain :: App env a -> IO () Source #

DefaultMain for App.

appMethod :: String -> Method Source #

Unsafely parse a Method from what could be a command line argument.

(NB. unsafe means this function is partial, you should use this function in conjunction with methodArg for the reverse parse and you will be fine).

methodArg :: Method -> String Source #

Serializes a Method to what should be a command-line argument later parsed via appMethod.

Utilities

getDependenciesOnly :: env -> DevOp env a -> Forest PreOp Source #

Evaluates the dependencies of a DevOp, discarding any result.

graphize :: Forest PreOp -> GraphData PreOp OpUniqueId Source #

Builds a Graph from dependencies represented as a Forest.

Nodes with a same hash in the Forest will correspond to the same node in the graph, hence, it's possible to create cycles by mistake if two nodes have a same hash by mistake (this is possible if the hash does not depend on all arguments to a DevOp).

opClosureFromB64 :: (Typeable env, Typeable a) => ByteString -> Closure (DevOp env a) Source #

Helper to deal with App when you want to use Closures as a serialization/deserialization mechanism.

You will likely add opClosureFromB64 in the _parseArgs field of your App and opClosureToB64 in the _revParse field.