Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/sync/repo"

Index

Variables

Const defaultDefaultBranch

defaultDefaultBranch: "master" = "master"

Functions

isRemoteRepo

  • isRemoteRepo(repo: SyncRepoRef | RemoteRepoRef): repo is RemoteRepoRef

queryForScmProvider

  • queryForScmProvider(sdm: SoftwareDeliveryMachine): Promise<boolean>
  • If called and no sync repo is provided in the SDM configuration, a warning is emitted and undefined is returned.

    If the SDM configuration contains a RemoteRepoRef as the value of the sdm.configuration.sdm.k8s.options.sync.repo option and truthy credentials, those are returned.

    Otherwise, the code cycles through all workspaces, querying cortex for the information it needs. If the value of the sync.repo option is a SyncRepoRef, each workspace is queried for a repo matching the provided sync repo. If none is found, it cycles through all the workspaces again querying for all SCM providers and try to clone the repo with the provided credentials or, if no credentials are provided, the SCM provider credentials from cortex. Once a repo is found using either method, an object is returned with its remote repo ref and the credentials able to clone it. In addition, the sdm passed in will have its sdm.configuration.sdm.k8s.options.sync.repo andsdm.configuration.sdm.k8s.options.sync.credentials updated with the objects appropriate objects.

    Parameters

    • sdm: SoftwareDeliveryMachine

      this SDM object (modified if repo credentials found)

    Returns Promise<boolean>

    true if sync options set and repo found or false and sync options deleted

queryRepo

  • queryRepo(sdm: SoftwareDeliveryMachine): Promise<RepoCredentials | undefined>

queryScm

  • queryScm(sdm: SoftwareDeliveryMachine): Promise<RepoCredentials | undefined>
  • For each SDM provider in cortex in each workspace, try to clone the sync repo. Return the information for the first successful clone.

    Parameters

    • sdm: SoftwareDeliveryMachine

    Returns Promise<RepoCredentials | undefined>

repoCredentials

  • Create RemoteRepoRef and Credentials object from SDM and repo from cortex. If the provided repo does not contain an org with a provider, it returns undefined. Otherwise it uses the SCM provider to call scmCredentials and return its value.

    Parameters

    • sdm: SoftwareDeliveryMachine
    • repo: Repo

    Returns RepoCredentials | undefined

repoSlug

scmCredentials

  • Given the SDM and an SCM, use the configured repo ref resolver to create a RemoteRepoRef. Use the SDM Kubernetes option sync credentials or SCM credential.secret to create the credentials, giving the SDM sync credentials preference. Return undefined if there is not enough information to created the repo credential object.

    Parameters

    Returns RepoCredentials | undefined

syncRepoRef

  • syncRepoRef(sdm: SoftwareDeliveryMachine): SyncRepoRef | RemoteRepoRef
  • Extract the Kubernetes option sync repo from the SDM configuration. This function should only be called if the sync repo object is defined.

    Parameters

    • sdm: SoftwareDeliveryMachine

    Returns SyncRepoRef | RemoteRepoRef

Generated using TypeDoc