Provides Jenkins integration with OpsLevel. This allows you to notify OpsLevel when a deploy succeeds.
- Get an OpsLevel account https://www.opslevel.com
- In the OpsLevel app, Click Integrations in the left sidebar
- Click on the + New Integration button
- Add the Jenkins Integration
- From your Jenkins home page, navigate to Manage Jenkins
- Navigate to Manage Plugins
- Change the tab to Available
- Search for 'opslevel'
- Check the box next to install & install the plugin
- From your Jenkins home page, navigate to Manage Jenkins
- Navigate to Configure System
- Find the Global OpsLevel Integration section
- In the OpsLevel App, copy the webhook URL from the Jenkins Integration we made:
- paste it into the Deploy Webhook URL box:
- 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:
- Navigate to your job and click Configure in the left sidebar
- Add an
opsLevelNotifyParams
post step with the desired parameter overrides: - 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
)
- Navigate to your job and click Configure in the left sidebar
- Add our post-build action Publish successful build to OpsLevel
- You can override notification parameters here:
Refer to jenkins plugin guidelines: contribution guidelines
Install Maven and JDK.
$ 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
mvn test
Create an HPI file to install in Jenkins
mvn clean package
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
.
Licensed under MIT, see LICENSE