https://github.com/opslevel/jenkins-opslevel-plugin
Jenkins plugin to notify OpsLevel about successful deploys from Jenkins projects and builds.
https://github.com/opslevel/jenkins-opslevel-plugin
Last synced: 12 months ago
JSON representation
Jenkins plugin to notify OpsLevel about successful deploys from Jenkins projects and builds.
- Host: GitHub
- URL: https://github.com/opslevel/jenkins-opslevel-plugin
- Owner: OpsLevel
- License: mit
- Created: 2021-05-27T20:00:28.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-04-21T21:14:14.000Z (about 1 year ago)
- Last Synced: 2025-04-23T11:40:18.378Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 680 KB
- Stars: 0
- Watchers: 3
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# OpsLevel plugin for Jenkins
[](https://app.opslevel.com/services/jenkins_plugin/maturity-report)
Provides Jenkins integration with OpsLevel. This allows you to notify OpsLevel when a deploy succeeds.
# Getting started
## Add a Jenkins Integration in OpsLevel
1. Get an OpsLevel account
1. In the OpsLevel app, Click **Integrations** in the left sidebar
1. Click on the **+ New Integration** button
1. Add the **Jenkins Integration**

## Install the Jenkins plugin
1. From your Jenkins home page, navigate to **Manage Jenkins**
1. Navigate to **Manage Plugins**
1. Change the tab to **Available**
1. Search for 'opslevel'
1. Check the box next to install & install the plugin
## Jenkins Configuration
### Global Configuration
1. From your Jenkins home page, navigate to **Manage Jenkins**
1. Navigate to **Configure System**
1. Find the **Global OpsLevel Integration** section
1. In the OpsLevel App, copy the webhook URL from the **Jenkins Integration** we made:

1. paste it into the **Deploy Webhook URL** box:

1. Click Save
OpsLevel will now be notified after every successful build!
If you need more fine grained control, you can override the notification parameters from within your builds/pipelines. Importantly, if you don't want to notify every single build, you could uncheck the **Notify for all builds** checkbox in the Global Configuration and just add build steps to the builds you care about. Similarly, if there only a few builds that you want to mute, you could enable notifications globally and override specific builds to not run. Here's a look at what the configuration looks like for both pipelines and freestyle jobs:
### Pipeline Configuration
1. Navigate to your job and click **Configure** in the left sidebar
1. Add an `opsLevelNotifyParams` post step with the desired parameter overrides:

1. Here's an example of the parameters you can override:
```
opsLevelNotifyParams(
webhookUrl: "https://app.opslevel.com/integrations/deploy/3e06d761-0347-4741-a617-XXXXXXXXXXX",
serviceAlias: "catalog_service",
environment: "Staging",
description: "Test Description",
deployUrl: "",
deployerId: "",
deployerEmail: "",
deployerName: "Jenkins Test Deploy",
run: true
)
```
### Freestyle Job Configuration
1. Navigate to your job and click **Configure** in the left sidebar
1. Add our post-build action **Publish successful build to OpsLevel**
1. You can override notification parameters here:

# Developer Instructions
Refer to jenkins plugin guidelines: [contribution guidelines](https://github.com/jenkinsci/.github/blob/master/CONTRIBUTING.md)
Install Maven and JDK.
```shell
$ mvn -version | grep -v home
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Java version: 15.0.2, vendor: N/A, runtime: /usr/local/Cellar/openjdk/15.0.2/libexec/openjdk.jdk/Contents/Home
Default locale: en_CA, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.7", arch: "x86_64", family: "mac"
```
Run unit tests
```shell
mvn test
```
## Create plugin package
Create an HPI file to install in Jenkins
```shell
mvn clean package
```
## Running Locally
Clone this repo, install Java & Maven, run this, and open `http://localhost:8080/jenkins/` in your browser.
```
env -i PATH=$PATH mvn hpi:run
```
That optional `env -i PATH=$PATH` removes all env vars except `PATH`.
## LICENSE
Licensed under MIT, see [LICENSE](LICENSE.md)