Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/deploy/spec"

Index

Functions

loadKubernetesSpec

  • loadKubernetesSpec(p: Project, base: string): Promise<KubernetesObject | undefined>
  • Read and parse either JSON or YAML file with basename base under .atomist/kubernetes in project. This function looks for base.json, base.yaml, and then base.yml. If it successfully reads and parses one of them into a truthy value, it returns its parsed value. If there are mulitple files matching those it looks for, it does not overlay/merge the parsed values. It stops after the first successfully parsed file.

    Parameters

    • p: Project
    • base: string

    Returns Promise<KubernetesObject | undefined>

parseKubernetesSpec

  • parseKubernetesSpec(p: Project, specPath: string): Promise<KubernetesObject | undefined>
  • Reads and parses Kubernetes JSON or YAML spec from the project. It swallows all exceptions, returning undefined if one occurs.

    If the specPath of the file ends with .yaml or .yml, the file contents are parsed as YAML. Otherwise it is parsed as JSON.

    Parameters

    • p: Project

      Project to look for spec file in

    • specPath: string

      Path of spec file to load

    Returns Promise<KubernetesObject | undefined>

    Parsed object if the spec was successfully read and parsed, undefined otherwise

parseKubernetesSpecFile

  • parseKubernetesSpecFile(specFile: ProjectFile): Promise<KubernetesObject>
  • Reads and parses Kubernetes JSON or YAML spec from the project.

    If the specFile.path of the file ends with .yaml or .yml, the file contents are parsed as YAML. Otherwise it is parsed as JSON.

    Parameters

    • specFile: ProjectFile

      File object of spec file to load

    Returns Promise<KubernetesObject>

    Parsed object of the spec

parseKubernetesSpecString

  • parseKubernetesSpecString(specString: string, specPath: string): Promise<KubernetesObject>
  • Parses content string as Kubernetes JSON or YAML spec. It parses the file as YAML, since JSON is valid YAML.

    Parameters

    • specString: string

      String representation of Kubernetes spec

    • specPath: string

      File path of Kubernetes spec file

    Returns Promise<KubernetesObject>

    Parsed object of the spec

Generated using TypeDoc