Skip to content

Latest commit

 

History

History
414 lines (251 loc) · 12.9 KB

API.md

File metadata and controls

414 lines (251 loc) · 12.9 KB

API Reference

Constructs

Jenkins

A jenkins instance.

Initializers

import { Jenkins } from 'cdk8s-jenkins'

new Jenkins(scope: Construct, id: string, props?: JenkinsProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props JenkinsProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsOptional

Methods

Name Description
toString Returns a string representation of this construct.
addBasePlugins Add base plugins to jenkins instance.
addPlugins Add custom plugins to jenkins instance.
addSeedJobs Add seed jobs to jenkins instance.

toString
public toString(): string

Returns a string representation of this construct.

addBasePlugins
public addBasePlugins(basePlugins: ...Plugin[]): void

Add base plugins to jenkins instance.

basePluginsRequired

List of base plugins.


addPlugins
public addPlugins(plugins: ...Plugin[]): void

Add custom plugins to jenkins instance.

pluginsRequired

List of custom plugins.


addSeedJobs
public addSeedJobs(seedJobs: ...SeedJob[]): void

Add seed jobs to jenkins instance.

seedJobsRequired

List of seed jobs.


Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Jenkins } from 'cdk8s-jenkins'

Jenkins.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


Structs

JenkinsProps

Props for Jenkins.

Initializer

import { JenkinsProps } from 'cdk8s-jenkins'

const jenkinsProps: JenkinsProps = { ... }

Properties

Name Type Description
basePlugins Plugin[] List of plugins required by Jenkins operator.
disableCsrfProtection boolean Toggle for CSRF Protection on Jenkins resource.
metadata cdk8s.ApiObjectMetadata Metadata associated with Jenkins resource.
plugins Plugin[] List of custom plugins applied to Jenkins resource.
seedJobs SeedJob[] List of seed job configuration for Jenkins resource.

basePluginsOptional
public readonly basePlugins: Plugin[];
  • Type: Plugin[]
  • Default: Default base plugins: { name: 'kubernetes', version: '1.31.3' }, { name: 'workflow-job', version: '1145.v7f2433caa07f' }, { name: 'workflow-aggregator', version: '2.6' }, { name: 'git', version: '4.10.3' }, { name: 'job-dsl', version: '1.78.1' }, { name: 'configuration-as-code', version: '1414.v878271fc496f' }, { name: 'kubernetes-credentials-provider', version: '0.20' }

List of plugins required by Jenkins operator.


disableCsrfProtectionOptional
public readonly disableCsrfProtection: boolean;
  • Type: boolean
  • Default: false

Toggle for CSRF Protection on Jenkins resource.


metadataOptional
public readonly metadata: ApiObjectMetadata;
  • Type: cdk8s.ApiObjectMetadata
  • Default: : Default metadata values: { name: An app-unique name generated by the chart, annotations: No annotations, labels: { app: 'jenkins' }, namespace: default, finalizers: No finalizers, ownerReferences: Automatically set by Kubernetes }

Metadata associated with Jenkins resource.


pluginsOptional
public readonly plugins: Plugin[];

List of custom plugins applied to Jenkins resource.


seedJobsOptional
public readonly seedJobs: SeedJob[];
  • Type: SeedJob[]
  • Default: No seed jobs

List of seed job configuration for Jenkins resource.

For more information about seed jobs, please take a look at {

[https://github.com/jenkinsci/job-dsl-plugin/wiki/Tutorial---Using-the-Jenkins-Job-DSL Jenkins Seed Jobs Documentation }.](https://github.com/jenkinsci/job-dsl-plugin/wiki/Tutorial---Using-the-Jenkins-Job-DSL Jenkins Seed Jobs Documentation }.)


Plugin

Jenkins plugin.

Initializer

import { Plugin } from 'cdk8s-jenkins'

const plugin: Plugin = { ... }

Properties

Name Type Description
name string The name of Jenkins plugin.
version string The version of Jenkins plugin.
downloadUrl string The url from where plugin has to be downloaded.

nameRequired
public readonly name: string;
  • Type: string

The name of Jenkins plugin.


versionRequired
public readonly version: string;
  • Type: string

The version of Jenkins plugin.


downloadUrlOptional
public readonly downloadUrl: string;
  • Type: string
  • Default: Plugins are downloaded from Jenkins Update Centers.

The url from where plugin has to be downloaded.

https://github.com/jenkinsci/kubernetes-operator/blob/master/pkg/configuration/base/resources/scripts_configmap.go#L121-L124


SeedJob

Jenkins seed job.

Initializer

import { SeedJob } from 'cdk8s-jenkins'

const seedJob: SeedJob = { ... }

Properties

Name Type Description
description string The description of the seed job.
id string The unique name for the seed job.
repositoryBranch string The repository branch where seed job definitions are present.
repositoryUrl string The repository access URL.
targets string The repository path where seed job definitions are present.

descriptionRequired
public readonly description: string;
  • Type: string

The description of the seed job.


idRequired
public readonly id: string;
  • Type: string

The unique name for the seed job.


repositoryBranchRequired
public readonly repositoryBranch: string;
  • Type: string

The repository branch where seed job definitions are present.


repositoryUrlRequired
public readonly repositoryUrl: string;
  • Type: string

The repository access URL.

Supports SSH and HTTPS.


targetsRequired
public readonly targets: string;
  • Type: string

The repository path where seed job definitions are present.