Skip to content

Instantly share code, notes, and snippets.

@micw
micw / install_jenkins_plugin.sh
Last active August 11, 2023 06:14
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins
@alecharp
alecharp / keep-jenkins-plugins-uptodate.groovy
Last active December 22, 2022 06:01
Simple groovy script to upgrade active plugins when new versions are available
jenkins.model.Jenkins.getInstance().getUpdateCenter().getSites().each { site ->
site.updateDirectlyNow(hudson.model.DownloadService.signatureCheck)
}
hudson.model.DownloadService.Downloadable.all().each { downloadable ->
downloadable.updateNow();
}
def plugins = jenkins.model.Jenkins.instance.pluginManager.activePlugins.findAll {
it -> it.hasUpdate()
@taherbs
taherbs / Jenkinsfile
Last active March 25, 2024 06:01
jenkins safe auto update plugins
def DATETIME = new Date().format('yyyy_MM_dd_HH_mm_ss', TimeZone.getTimeZone('Canada/Eastern'))
def pluginsToReviewManually = []
def pluginsDeprecated = []
pipeline {
agent { label 'master' }
options {
//Build options
disableConcurrentBuilds()
buildDiscarder(
logRotator (