Pipeline Parameters and Resources - michaelsauter/ods-pipeline GitHub Wiki

Pipeline Params

The following parameters are set by the ODS webhook interceptor on every pipeline run:

  • project: The name of project (Bitbucket project in lowercase).
  • repository-url: The URL of the Git repository.
  • repository: Name of the repository.
  • git-ref: E.g. master or v1.0 - if a repository defines child repositories, then each of those repositories is required to have the same Git refs.
  • git-ref-spec: E.g. refs/heads/master or refs/tags/v1.0.
  • git-ref-prefix: Empty or the value of gitRef before the first slash (/), e.g. release for release/1.0
  • environment: If the environments config in .ods.yml maps the gitRef to an environment, it is set to the environment (dev, qa or prod). Otherwise, environment is empty.
  • version: If the gitRef contains a version (release/X or vX), it is set to that version (X). Otherwise, the version is set to WIP.
  • target: default for now. This could be used in the future to be able to distinguish between deployment targets (multi-cluster deploy). However at this stage the concept for that is not finalized.
  • trigger-event: The type of webhook event triggering the pipeline (e.g. repo:refs_changed).
  • comment: If a comment can be extracted from the webhook event payload, the text of the comment, otherwise empty.

Results

The first task, ods-init sets the following results:

  • <REPOSITORY>-git-sha: Commit SHA for each checked out repository

ConfigMap and Secret resources

Pipelines can also make use of ConfigMap and Secret resources in the *-cd namespace, either by exposing them as environment variables or mounting them as volumes.

ODS provides the following resources:

  • ConfigMap nexus with key url
  • Secret nexus-auth with keys username and password
  • ConfigMap sonarqube with key url
  • Secret sonarqube-auth with keys username and password (an auth token)
  • ConfigMap bitbucket with keys url and repoBase
  • Secret bitbucket-auth with keys username and password (a personal access token)
  • ConfigMap registry with key url (internal OpenShift image registry)
⚠️ **GitHub.com Fallback** ⚠️