Categorygithub.com/frantjc/jenkins-job-resource
repositorypackage
0.1.1
Repository: https://github.com/frantjc/jenkins-job-resource.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

jenkins-job-resource CI godoc goreportcard license

A Concourse resource for Jenkins jobs.

Example

resource_types:
  - name: jenkins-job-resource
    type: registry-image
    source:
      repository: ghcr.io/frantjc/jenkins-job-resource
      tag: latest
resources:
  - name: my-jenkins-job
    type: jenkins-job-resource
    source:
jobs:
  - name: some-job
    plan:
      - put: my-jenkins-job
        params:
          cause: some-job in Concourse caused this build
          build_params:
            foo: bar
  - name: another-job
    plan:
      - get: my-jenkins-job

Source Configuration

ParameterRequiredExampleDescription
urlyeshttps://my-jenkins.comthe base url for a Jenkins deployment
jobyesthe job name in the Jenkins deployment at the given url
tokenfor putsee below (1)the Authentication Token for the given job
usernameunknown, but likelya username that can be used to authorize with the given Jenkins url
loginunknown, but likelyeither the password or an api token associated with the given username

Note: if login is set, then surely username must be set to a corresponding username for it to have any effect. It is unknown if a Jenkins deployment can be configured such that both username and login are not required

build-triggers

(1) the above can be found at $YOUR_JENKINS > $YOUR_JOB > Configure

Behavior

check

Produces new versions for all builds (after the last version) ordered by the build number

in

ParameterRequiredExampleDescription
accept_resultsno[SUCCESS]array of acceptable results of the build. The step will fail if none match. Empty arrays are ignored
regexpno[path/to/output.*]limits downloaded artifacts to only those that match one of the given patterns. Hidden files (ex: .git) will be ignored
skip_downloadnowhether or not to download any of the artifacts at all. Overrides regexp. Default false

Optionally gets the specified artifacts outputted by the most recent build

Metadata is made available at ./.metadata/name. ex:

$ cat ./my-jenkins-job/.metadata/result
SUCCESS

out

ParameterRequiredExampleDescription
causenothe cause of the build being triggered. Default caused by $ATC_EXTERNAL_URL/builds/$BUILD_ID
cause_filenopath/to/causepath to a file containing the cause of the build being triggered
descriptionnothe description of the build. Default build triggered by $ATC_EXTERNAL_URL/builds/$BUILD_ID
description_filenopath/to/descriptionpath to a file containing the description of the build
build_paramsnoany objectname-value pairs that will be passed to the build as build parameters

Triggers a new build of the target job and gets the result

developing

  • make is recommended - version 3.81 is tested
  • golang is required - version 1.18.x or above is required for generics
  • docker is required - version 20.10.x is tested