Something went wrong. Try again.
A collection of +180 reusable WebAssembly modules for building composable CI/CD pipelines with FluentCI fluentci.io/modules
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105-- Generated by Gleam CI helpers.module CI.Component (setup, run, version, validate, migrate, license_check, evaluate) where
import Preludeimport CI.Contract as Contractimport Data.Maybe (Maybe)import Effect (Effect)import CI.ModuleDependencies as Dependenciesimport CI.CLI as Nativeimport CI.ContainerSetup as ContainerSetup
-- | Ensure flipt is installed and verified, reusing an available matching version, and publish its environment.-- | @param version Tool release or supported channel to install; omitted values use the documented default.-- | @param installDir Absolute per-user installation prefix; omit for native package installations.-- | @param packageName Native package or port selector overriding the default repository package name.-- | @param sudo Use noninteractive sudo for native package or system installation; defaults to false.setup :: { version :: Maybe String, installDir :: Maybe String, packageName :: Maybe String, sudo :: Maybe Boolean } -> Effect Contract.SetupResultsetup args = do ContainerSetup.setupWith (Contract.input (Contract.encodeInput args))
-- | Run any Flipt CLI command as literal native arguments.-- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".".-- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist.-- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool.-- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000.-- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas.-- | @param arguments Native Flipt command and argument tokens as comma-separated text; never JSON objects or arrays.run :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, arguments :: String } -> Effect Contract.ExecutionResultrun args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "flipt" "run" json
-- | Report the installed Flipt version.-- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".".-- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist.-- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool.-- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000.-- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas.version :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String } -> Effect Contract.ExecutionResultversion args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "flipt" "version" json
-- | Validate flag-state YAML and fail the pipeline on validation issues.-- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".".-- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist.-- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool.-- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000.-- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas.-- | @param files Comma-separated YAML flag-state paths, relative to workDir; omitted or blank validates the configured state tree.-- | @param workDir Existing directory used as the flag-state filesystem root.-- | @param extraSchema Existing schema extension file with additional validation constraints.-- | @param format Validation output format. Default: "json". Allowed values: json, text.-- | @param issueExitCode Positive exit code for validation findings; zero is deliberately disallowed so this function remains a CI gate. Default: 1.-- | @param extraArgs Additional literal native tokens as comma-separated text; CSV quotes preserve commas. Do not include secrets, since command arguments are recorded in reports.validate :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, files :: Maybe String, workDir :: Maybe String, extraSchema :: Maybe String, format :: Maybe String, issueExitCode :: Maybe Int, extraArgs :: Maybe String } -> Effect Contract.ExecutionResultvalidate args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "flipt" "validate" json
-- | Run pending Flipt v2 analytics database migrations with the selected server configuration.-- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".".-- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist.-- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool.-- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000.-- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas.-- | @param config Existing Flipt server configuration file; credentials can remain in native server configuration or environment.-- | @param extraArgs Additional literal native tokens as comma-separated text; CSV quotes preserve commas. Do not include secrets, since command arguments are recorded in reports.migrate :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, extraArgs :: Maybe String } -> Effect Contract.ExecutionResultmigrate args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "flipt" "migrate" json
-- | Check the configured Flipt Pro license status with the native licensing service.-- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".".-- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist.-- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool.-- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000.-- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas.-- | @param config Existing Flipt server configuration file; credentials can remain in native server configuration or environment.-- | @param extraArgs Additional literal native tokens as comma-separated text; CSV quotes preserve commas. Do not include secrets, since command arguments are recorded in reports.license_check :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, config :: Maybe String, extraArgs :: Maybe String } -> Effect Contract.ExecutionResultlicense_check args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "flipt" "license_check" json
-- | Evaluate a feature flag once without watch mode; upstream evaluation failures propagate.-- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".".-- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist.-- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool.-- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000.-- | @param artifacts Comma-separated NAME=PATH output artifacts; use CSV double quotes around entries containing commas.-- | @param flagKey Feature flag key to evaluate once.-- | @param address HTTP or gRPC address of the Flipt instance; defaults to the native localhost endpoint.-- | @param environment Flipt environment key.-- | @param namespace Flipt namespace key.-- | @param entityId Stable evaluation entity ID for reproducible pipeline checks.-- | @param requestId Evaluation request correlation ID.-- | @param context Comma-separated evaluation KEY=VALUE context entries; no JSON object is accepted.-- | @param extraArgs Additional literal native tokens as comma-separated text; CSV quotes preserve commas. Do not include secrets, since command arguments are recorded in reports.evaluate :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, flagKey :: String, address :: Maybe String, environment :: Maybe String, namespace :: Maybe String, entityId :: Maybe String, requestId :: Maybe String, context :: Maybe String, extraArgs :: Maybe String } -> Effect Contract.ExecutionResultevaluate args = do json <- Native.csvInput (Contract.input (Contract.encodeInput args)) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "flipt" "evaluate" json