Source

Source define the 'what' you want to update

Description

The "source" stage retrieve an information from a third "resource" like a file, an api and then inject that information in later stages.

Parameters

NameRequiredDefaultDescription

kind

-

Define the resource type used for the spec

name

-

Small description used in message, reports, etc.

scm

-

-

Define source control management parameters, cfr to the scm

spec

-

Define resource parameters, cfr to appropriated resource documentation

Example

updatecli.yaml
sources:
  latestVersion:
    name: Get latest Venom release
    kind: githubRelease
    spec:
      owner: ovh
      repository: venom
      # Value from environment variable '$UPDATECLI_GITHUB_TOKEN'
      token: '{{ requiredEnv "UPDATECLI_GITHUB_TOKEN" }}'
      # Value from environment variable '$UPDATECLI_GITHUB_ACTOR'
      username: '{{ requiredEnv "UPDATECLI_GITHUB_ACTOR" }}'
      versioning:
        kind: semver
    transformers:
      - addPrefix: "v"

In this example we are looking for the latest release tag from https://github.com/jenkinsci/jenkins which is 'jenkins-2.75'. Unfortunately it contains the prefix "jenkins" which is useless for later stages, so we replace 'jenkins-' by nothing so the output of the source becomes "jenkins/jenkins:2.275-jdk" which is a valid docker image that can now be used in the later stages.

Edit this page on GitHub