New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cdk8s-jenkins

Package Overview
Dependencies
Maintainers
1
Versions
480
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cdk8s-jenkins - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

lib/imports/jenkins.io.d.ts

377

API.md
# API Reference <a name="API Reference" id="api-reference"></a>
## Constructs <a name="Constructs" id="Constructs"></a>
### Jenkins <a name="Jenkins" id="cdk8s-jenkins.Jenkins"></a>
## Classes <a name="Classes" id="Classes"></a>
A jenkins instance.
### Hello <a name="Hello" id="cdk8s-jenkins.Hello"></a>
#### Initializers <a name="Initializers" id="cdk8s-jenkins.Jenkins.Initializer"></a>
#### Initializers <a name="Initializers" id="cdk8s-jenkins.Hello.Initializer"></a>
```typescript
import { Hello } from 'cdk8s-jenkins'
import { Jenkins } from 'cdk8s-jenkins'
new Hello()
new Jenkins(scope: Construct, id: string, props?: JenkinsProps)
```

@@ -19,5 +19,26 @@

| --- | --- | --- |
| <code><a href="#cdk8s-jenkins.Jenkins.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
| <code><a href="#cdk8s-jenkins.Jenkins.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cdk8s-jenkins.Jenkins.Initializer.parameter.props">props</a></code> | <code><a href="#cdk8s-jenkins.JenkinsProps">JenkinsProps</a></code> | *No description.* |
---
##### `scope`<sup>Required</sup> <a name="scope" id="cdk8s-jenkins.Jenkins.Initializer.parameter.scope"></a>
- *Type:* constructs.Construct
---
##### `id`<sup>Required</sup> <a name="id" id="cdk8s-jenkins.Jenkins.Initializer.parameter.id"></a>
- *Type:* string
---
##### `props`<sup>Optional</sup> <a name="props" id="cdk8s-jenkins.Jenkins.Initializer.parameter.props"></a>
- *Type:* <a href="#cdk8s-jenkins.JenkinsProps">JenkinsProps</a>
---
#### Methods <a name="Methods" id="Methods"></a>

@@ -27,15 +48,353 @@

| --- | --- |
| <code><a href="#cdk8s-jenkins.Hello.sayHello">sayHello</a></code> | *No description.* |
| <code><a href="#cdk8s-jenkins.Jenkins.toString">toString</a></code> | Returns a string representation of this construct. |
| <code><a href="#cdk8s-jenkins.Jenkins.addBasePlugins">addBasePlugins</a></code> | Add base plugins to jenkins instance. |
| <code><a href="#cdk8s-jenkins.Jenkins.addPlugins">addPlugins</a></code> | Add custom plugins to jenkins instance. |
| <code><a href="#cdk8s-jenkins.Jenkins.addSeedJobs">addSeedJobs</a></code> | Add seed jobs to jenkins instance. |
---
##### `sayHello` <a name="sayHello" id="cdk8s-jenkins.Hello.sayHello"></a>
##### `toString` <a name="toString" id="cdk8s-jenkins.Jenkins.toString"></a>
```typescript
public sayHello(): string
public toString(): string
```
Returns a string representation of this construct.
##### `addBasePlugins` <a name="addBasePlugins" id="cdk8s-jenkins.Jenkins.addBasePlugins"></a>
```typescript
public addBasePlugins(basePlugins: Plugin): void
```
Add base plugins to jenkins instance.
###### `basePlugins`<sup>Required</sup> <a name="basePlugins" id="cdk8s-jenkins.Jenkins.addBasePlugins.parameter.basePlugins"></a>
- *Type:* <a href="#cdk8s-jenkins.Plugin">Plugin</a>
List of base plugins.
---
##### `addPlugins` <a name="addPlugins" id="cdk8s-jenkins.Jenkins.addPlugins"></a>
```typescript
public addPlugins(plugins: Plugin): void
```
Add custom plugins to jenkins instance.
###### `plugins`<sup>Required</sup> <a name="plugins" id="cdk8s-jenkins.Jenkins.addPlugins.parameter.plugins"></a>
- *Type:* <a href="#cdk8s-jenkins.Plugin">Plugin</a>
List of custom plugins.
---
##### `addSeedJobs` <a name="addSeedJobs" id="cdk8s-jenkins.Jenkins.addSeedJobs"></a>
```typescript
public addSeedJobs(seedJobs: SeedJob): void
```
Add seed jobs to jenkins instance.
###### `seedJobs`<sup>Required</sup> <a name="seedJobs" id="cdk8s-jenkins.Jenkins.addSeedJobs.parameter.seedJobs"></a>
- *Type:* <a href="#cdk8s-jenkins.SeedJob">SeedJob</a>
List of seed jobs.
---
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
| **Name** | **Description** |
| --- | --- |
| <code><a href="#cdk8s-jenkins.Jenkins.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
---
##### ~~`isConstruct`~~ <a name="isConstruct" id="cdk8s-jenkins.Jenkins.isConstruct"></a>
```typescript
import { Jenkins } from 'cdk8s-jenkins'
Jenkins.isConstruct(x: any)
```
Checks if `x` is a construct.
###### `x`<sup>Required</sup> <a name="x" id="cdk8s-jenkins.Jenkins.isConstruct.parameter.x"></a>
- *Type:* any
Any object.
---
#### Properties <a name="Properties" id="Properties"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s-jenkins.Jenkins.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
---
##### `node`<sup>Required</sup> <a name="node" id="cdk8s-jenkins.Jenkins.property.node"></a>
```typescript
public readonly node: Node;
```
- *Type:* constructs.Node
The tree node.
---
## Structs <a name="Structs" id="Structs"></a>
### JenkinsProps <a name="JenkinsProps" id="cdk8s-jenkins.JenkinsProps"></a>
Props for `Jenkins`.
#### Initializer <a name="Initializer" id="cdk8s-jenkins.JenkinsProps.Initializer"></a>
```typescript
import { JenkinsProps } from 'cdk8s-jenkins'
const jenkinsProps: JenkinsProps = { ... }
```
#### Properties <a name="Properties" id="Properties"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s-jenkins.JenkinsProps.property.basePlugins">basePlugins</a></code> | <code><a href="#cdk8s-jenkins.Plugin">Plugin</a>[]</code> | List of plugins required by Jenkins operator. |
| <code><a href="#cdk8s-jenkins.JenkinsProps.property.disableCsrfProtection">disableCsrfProtection</a></code> | <code>boolean</code> | Toggle for CSRF Protection on Jenkins resource. |
| <code><a href="#cdk8s-jenkins.JenkinsProps.property.metadata">metadata</a></code> | <code>cdk8s.ApiObjectMetadata</code> | Metadata associated with Jenkins resource. |
| <code><a href="#cdk8s-jenkins.JenkinsProps.property.plugins">plugins</a></code> | <code><a href="#cdk8s-jenkins.Plugin">Plugin</a>[]</code> | List of custom plugins applied to Jenkins resource. |
| <code><a href="#cdk8s-jenkins.JenkinsProps.property.seedJobs">seedJobs</a></code> | <code><a href="#cdk8s-jenkins.SeedJob">SeedJob</a>[]</code> | List of seed job configuration for Jenkins resource. |
---
##### `basePlugins`<sup>Optional</sup> <a name="basePlugins" id="cdk8s-jenkins.JenkinsProps.property.basePlugins"></a>
```typescript
public readonly basePlugins: Plugin[];
```
- *Type:* <a href="#cdk8s-jenkins.Plugin">Plugin</a>[]
- *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.
---
##### `disableCsrfProtection`<sup>Optional</sup> <a name="disableCsrfProtection" id="cdk8s-jenkins.JenkinsProps.property.disableCsrfProtection"></a>
```typescript
public readonly disableCsrfProtection: boolean;
```
- *Type:* boolean
- *Default:* false
Toggle for CSRF Protection on Jenkins resource.
---
##### `metadata`<sup>Optional</sup> <a name="metadata" id="cdk8s-jenkins.JenkinsProps.property.metadata"></a>
```typescript
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.
---
##### `plugins`<sup>Optional</sup> <a name="plugins" id="cdk8s-jenkins.JenkinsProps.property.plugins"></a>
```typescript
public readonly plugins: Plugin[];
```
- *Type:* <a href="#cdk8s-jenkins.Plugin">Plugin</a>[]
- *Default:* []
List of custom plugins applied to Jenkins resource.
---
##### `seedJobs`<sup>Optional</sup> <a name="seedJobs" id="cdk8s-jenkins.JenkinsProps.property.seedJobs"></a>
```typescript
public readonly seedJobs: SeedJob[];
```
- *Type:* <a href="#cdk8s-jenkins.SeedJob">SeedJob</a>[]
- *Default:* No seed jobs
List of seed job configuration for Jenkins resource.
For more information about seed jobs, please take a look at { @link https://github.com/jenkinsci/job-dsl-plugin/wiki/Tutorial---Using-the-Jenkins-Job-DSL Jenkins Seed Jobs Documentation }.
---
### Plugin <a name="Plugin" id="cdk8s-jenkins.Plugin"></a>
Jenkins plugin.
#### Initializer <a name="Initializer" id="cdk8s-jenkins.Plugin.Initializer"></a>
```typescript
import { Plugin } from 'cdk8s-jenkins'
const plugin: Plugin = { ... }
```
#### Properties <a name="Properties" id="Properties"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s-jenkins.Plugin.property.name">name</a></code> | <code>string</code> | The name of Jenkins plugin. |
| <code><a href="#cdk8s-jenkins.Plugin.property.version">version</a></code> | <code>string</code> | The version of Jenkins plugin. |
| <code><a href="#cdk8s-jenkins.Plugin.property.downloadUrl">downloadUrl</a></code> | <code>string</code> | The url from where plugin has to be downloaded. |
---
##### `name`<sup>Required</sup> <a name="name" id="cdk8s-jenkins.Plugin.property.name"></a>
```typescript
public readonly name: string;
```
- *Type:* string
The name of Jenkins plugin.
---
##### `version`<sup>Required</sup> <a name="version" id="cdk8s-jenkins.Plugin.property.version"></a>
```typescript
public readonly version: string;
```
- *Type:* string
The version of Jenkins plugin.
---
##### `downloadUrl`<sup>Optional</sup> <a name="downloadUrl" id="cdk8s-jenkins.Plugin.property.downloadUrl"></a>
```typescript
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](https://github.com/jenkinsci/kubernetes-operator/blob/master/pkg/configuration/base/resources/scripts_configmap.go#L121-L124)
---
### SeedJob <a name="SeedJob" id="cdk8s-jenkins.SeedJob"></a>
Jenkins seed job.
#### Initializer <a name="Initializer" id="cdk8s-jenkins.SeedJob.Initializer"></a>
```typescript
import { SeedJob } from 'cdk8s-jenkins'
const seedJob: SeedJob = { ... }
```
#### Properties <a name="Properties" id="Properties"></a>
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cdk8s-jenkins.SeedJob.property.description">description</a></code> | <code>string</code> | The description of the seed job. |
| <code><a href="#cdk8s-jenkins.SeedJob.property.id">id</a></code> | <code>string</code> | The unique name for the seed job. |
| <code><a href="#cdk8s-jenkins.SeedJob.property.repositoryBranch">repositoryBranch</a></code> | <code>string</code> | The repository branch where seed job definitions are present. |
| <code><a href="#cdk8s-jenkins.SeedJob.property.repositoryUrl">repositoryUrl</a></code> | <code>string</code> | The repository access URL. |
| <code><a href="#cdk8s-jenkins.SeedJob.property.targets">targets</a></code> | <code>string</code> | The repository path where seed job definitions are present. |
---
##### `description`<sup>Required</sup> <a name="description" id="cdk8s-jenkins.SeedJob.property.description"></a>
```typescript
public readonly description: string;
```
- *Type:* string
The description of the seed job.
---
##### `id`<sup>Required</sup> <a name="id" id="cdk8s-jenkins.SeedJob.property.id"></a>
```typescript
public readonly id: string;
```
- *Type:* string
The unique name for the seed job.
---
##### `repositoryBranch`<sup>Required</sup> <a name="repositoryBranch" id="cdk8s-jenkins.SeedJob.property.repositoryBranch"></a>
```typescript
public readonly repositoryBranch: string;
```
- *Type:* string
The repository branch where seed job definitions are present.
---
##### `repositoryUrl`<sup>Required</sup> <a name="repositoryUrl" id="cdk8s-jenkins.SeedJob.property.repositoryUrl"></a>
```typescript
public readonly repositoryUrl: string;
```
- *Type:* string
The repository access URL.
Supports SSH and HTTPS.
---
##### `targets`<sup>Required</sup> <a name="targets" id="cdk8s-jenkins.SeedJob.property.targets"></a>
```typescript
public readonly targets: string;
```
- *Type:* string
The repository path where seed job definitions are present.
---

5

lib/index.d.ts

@@ -1,4 +0,1 @@

export declare class Hello {
sayHello(): string;
}
//# sourceMappingURL=index.d.ts.map
export * from './jenkins';
"use strict";
var _a;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Hello = void 0;
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
class Hello {
sayHello() {
return 'hello, world!';
}
}
exports.Hello = Hello;
_a = JSII_RTTI_SYMBOL_1;
Hello[_a] = { fqn: "cdk8s-jenkins.Hello", version: "0.0.1" };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxNQUFhLEtBQUs7SUFDVCxRQUFRO1FBQ2IsT0FBTyxlQUFlLENBQUM7SUFDekIsQ0FBQzs7QUFISCxzQkFJQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjbGFzcyBIZWxsbyB7XG4gIHB1YmxpYyBzYXlIZWxsbygpIHtcbiAgICByZXR1cm4gJ2hlbGxvLCB3b3JsZCEnO1xuICB9XG59Il19
__exportStar(require("./jenkins"), exports);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQUEsNENBQTBCIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9qZW5raW5zJzsiXX0=

@@ -42,3 +42,4 @@ {

"devDependencies": {
"@types/jest": "^28.1.0",
"@cdk8s/projen-common": "^0.0.35",
"@types/jest": "^27.5.1",
"@types/node": "^14",

@@ -55,12 +56,12 @@ "@typescript-eslint/eslint-plugin": "^5",

"jest-junit": "^13",
"jsii": "^1.59.0",
"jsii-diff": "^1.59.0",
"jsii-docgen": "^7.0.26",
"jsii-pacmak": "^1.59.0",
"jsii": "^1.62.0",
"jsii-diff": "^1.62.0",
"jsii-docgen": "^7.0.54",
"jsii-pacmak": "^1.62.0",
"json-schema": "^0.4.0",
"npm-check-updates": "^12",
"projen": "^0.57.2",
"npm-check-updates": "^15",
"projen": "^0.59.2",
"standard-version": "^9",
"ts-jest": "^27",
"typescript": "^4.7.3"
"typescript": "^4.7.4"
},

@@ -76,7 +77,11 @@ "peerDependencies": {

"license": "Apache-2.0",
"version": "0.0.1",
"version": "0.0.2",
"jest": {
"coveragePathIgnorePatterns": [
"/node_modules/",
"src/imports/*"
],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.ts?(x)",
"<rootDir>/(test|src)/**/?(*.)+(spec|test).ts?(x)"
"<rootDir>/(test|src)/**/*(*.)@(spec|test).ts?(x)"
],

@@ -93,5 +98,2 @@ "clearMocks": true,

"coverageDirectory": "coverage",
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"testPathIgnorePatterns": [

@@ -98,0 +100,0 @@ "/node_modules/"

@@ -1,1 +0,138 @@

# This library is currently under development. Stay tuned!
# cdk8s-jenkins
`cdk8s-jenkins` is a library that lets you easily define a manifest for deploying a Jenkins instance to your Kubernetes cluster.
## Prerequisites
This library uses a Custom Resource Definition provided by jenkins, and thus requires both the CRD and the operator to be installed on the cluster.
You can set this up by,
1. Apply the Custom Resource Definition(CRD) for jenkins on your Kubernetes cluster.
```
kubectl apply -f https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/config/crd/bases/jenkins.io_jenkins.yaml
```
2. Install the Jenkins Operator on your Kubernetes cluster.
```
kubectl apply -f https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/deploy/all-in-one-v1alpha2.yaml
```
> For more information regarding applying jenkins crd and installing jenkins operator, please refer [jenkins official documentaion](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/installing-the-operator/).
## Usage
The library provides a high level `Jenkins` construct to provision a Jenkins instance.
You can just instantiate the Jenkins instance and that would add a Jenkins resource to the kubernetes manifest.
The library provide a set of defaults, so provisioning a basic Jenkins instance requires no configuration:
```ts
import { Jenkins } from 'cdk8s-jenkins';
// inside your chart:
const jenkins = new Jenkins(this, 'my-jenkins');
```
The library also enables configuring the following parmeters for the Jenkins instance:
### metadata
```ts
const jenkins = new Jenkins(this, 'my-jenkins', {
metadata: {
namespace: 'jenkins-namespace',
labels: { customApp: 'my-jenkins' },
},
});
```
### disableCsrfProtection
This allows you to toggle CSRF Protection for Jenkins.
```ts
const jenkins = new Jenkins(this, 'my-jenkins', {
disableCsrfProtection: true,
});
```
### basePlugins
These are the plugins required by the jenkins operator.
```ts
const jenkins = new Jenkins(this, 'my-jenkins', {
basePlugins: [{
name: 'configuration-as-code',
version: '1.55',
}],
});
```
You can also utilize `addBasePlugins` function to add base plugins to jenkins configuration after initialization.
```ts
const jenkins = new Jenkins(this, 'my-jenkins');
jenkins.addBasePlugins([{
name: 'workflow-api',
version: '2.76',
}]);
```
### plugins
These are the plugins that you can add to your jenkins instance.
```ts
const jenkins = new Jenkins(this, 'my-jenkins', {
plugins: [{
name: 'simple-theme-plugin',
version: '0.7',
}],
});
```
You can also utilize `addPlugins` function to add plugins to jenkins configuration after initialization.
```ts
const jenkins = new Jenkins(this, 'my-jenkins');
jenkins.addPlugins([{
name: 'simple-theme-plugin',
version: '0.7',
}]);
```
### seedJobs
You can define list of jenkins seed job configurations here. For more info you can take look at [jenkins documentation](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/configuring-seed-jobs-and-pipelines/).
```ts
const jenkins = new Jenkins(this, 'my-jenkins', {
seedJobs: [{
id: 'jenkins-operator',
targets: 'cicd/jobs/*.jenkins',
description: 'Jenkins Operator repository',
repositoryBranch: 'master',
repositoryUrl: 'https://github.com/jenkinsci/kubernetes-operator.git',
}],
});
```
You can also utilize `addSeedJobs` function to add seed jobs to jenkins configuration after initialization.
```ts
const jenkins = new Jenkins(this, 'my-jenkins');
jenkins.addSeedJobs([{
id: 'jenkins-operator',
targets: 'cicd/jobs/*.jenkins',
description: 'Jenkins Operator repository',
repositoryBranch: 'master',
repositoryUrl: 'https://github.com/jenkinsci/kubernetes-operator.git',
}]);
```
## Using escape hatches
You can utilize escape hatches to make changes to the configurations that are not yet exposed by the library.
For instance, if you would like to update the version of a base plugin:
```ts
const jenkins = new Jenkins(this, 'my-jenkins');
const jenkinsApiObject = ApiObject.of(jenkins);
jenkinsApiObject.addJsonPatch(JsonPatch.replace('/spec/master/basePlugins/1', {
name: 'workflow-job',
version: '3.00',
}));
```
For more information regarding escape hatches, take a look at [cdk8s documentation](https://cdk8s.io/docs/latest/concepts/escape-hatches/).
## Security
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more
information.
## License
This project is licensed under the Apache-2.0 License.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc