clue/deploy/configs

clue.deploy.yaml / clue.deploy.json configuration for the clue deploy system. Parsed into Nim objects via openparser's typed deserializers (fromJson / parseYAML), so both formats share one object graph.

Types

DeployConfig = object
  path*: string
  project*: string
  version*: string
  web*: WebConfig
  dir*: DirConfig
DirConfig = object
  profiles*: OrderedTableRef[string, DirProfile]
DirProfile = object
  name*: string
  to*: string
  host*: string
  user*: string
  port*: int
  sshKey*: string
  exclude*: seq[string]
  delete*: bool
  checksum*: bool
  compress*: Option[bool]
  timeout*: int
  release*: ReleaseConfig
  steps*: seq[RunStep]
A directory placement profile: sync from to to. to is a local path, unless host is set — then it is a remote path on user@host reached over ssh. There is intentionally no password field: when no sshKey is configured, clue prompts for the password at deploy time and keeps it only in process memory.
ReleaseConfig = object
  repo*: string
  asset*: string
  mode*: string
  binary*: string
Optional GitHub release sourcing for a dir profile: when repo is set, the deployed binary comes from the latest release of the public owner/name repo instead of the local from dir. mode is local (download and extract on this machine into a staging dir, then rsync as usual) or remote (curl and extract directly on the target host). binary names the binary inside archive assets (required there) and renames raw assets.
RunStep = object
  name*: string
  run*: string
One script step executed on the host, GH-runner style: - run: whoami. name is an optional label shown in the output.
SystemdConfig = object
  service*: string
  unitFile*: string
  unitRemotePath*: string
  daemonReload*: Option[bool]
  enable*: bool
  restart*: Option[bool]
  sudo*: Option[bool]
  status*: Option[bool]
WebConfig = object
  localDir*: string
  profiles*: OrderedTableRef[string, WebProfile]
WebProfile = object
  name*: string
  host*: string
  user*: string
  port*: int
  sshKey*: string
  remoteDir*: string
  exclude*: seq[string]
  delete*: bool
  checksum*: bool
  compress*: Option[bool]
  partial*: Option[bool]
  timeout*: int
  preBuild*: seq[string]
  postDeploy*: seq[string]
  steps*: seq[RunStep]
  systemd*: SystemdConfig

Procs

func compressOn(p: WebProfile): bool {....raises: [], tags: [], forbids: [].}
proc expandPath(s: string): string {....raises: [],
                                     tags: [ReadEnvEffect, ReadIOEffect],
                                     forbids: [].}
Expand ~ and $VAR / ${VAR} in a config value (e.g. an ssh key path).
proc findDeployConfig(customPath = ""): string {....raises: [IOError, OSError],
    tags: [ReadDirEffect], forbids: [].}
Locate the deploy config in the current directory (or customPath).
proc parseDeployConfig(path: string): DeployConfig {....raises: [IOError,
    OpenParserJsonError, ValueError, OpenParserYamlError, KeyError, Exception],
    tags: [ReadDirEffect, ReadIOEffect, RootEffect], forbids: [].}
Parse a clue.deploy.yaml / clue.deploy.json file into a DeployConfig.
func partialOn(p: WebProfile): bool {....raises: [], tags: [], forbids: [].}
func sdDaemonReload(s: SystemdConfig): bool {....raises: [], tags: [], forbids: [].}
func sdRestart(s: SystemdConfig): bool {....raises: [], tags: [], forbids: [].}
func sdStatus(s: SystemdConfig): bool {....raises: [], tags: [], forbids: [].}
func sdSudo(s: SystemdConfig): bool {....raises: [], tags: [], forbids: [].}