Skip to content

Instantly share code, notes, and snippets.

Avatar

Antoś Bućko Paladin-Dranser

  • EPAM Systems
  • Minsk
View GitHub Profile
@Paladin-Dranser
Paladin-Dranser / authorizeProjectConfiguration.groovy
Last active Jan 14, 2021
Jenkins: Groovy script to configure Authorize Project settings
View authorizeProjectConfiguration.groovy
/**
* The script removes Build Authorization settings
* (Jenkins - Configure Global Security - Access Control for Builds)
* and creates:
* - Per-project 'Run as Specific User'
* - Default Project 'Run as User Who Triggered Build'
*
* Issue:
* Authorize Project plugin doesn't full support JCasC plugin configuration
* For more details, see: https://github.com/jenkinsci/authorize-project-plugin/pull/44
@Paladin-Dranser
Paladin-Dranser / deleteEmptyViews.groovy
Last active Sep 24, 2020
Jenkins: Groovy script to delete empty views
View deleteEmptyViews.groovy
/**
* This script deletes empty views
*/
import jenkins.model.Jenkins
import hudson.model.View
Jenkins instance = Jenkins.get()
ArrayList<View> views = instance.getViews()
@Paladin-Dranser
Paladin-Dranser / cleanupJenkinsWorkspaces.groovy
Last active Sep 24, 2020 — forked from EvilBeaver/cleanupJenkinsWorkspaces.groovy
Jenkins: Groovy script to clean up workspace on Jenkins agents
View cleanupJenkinsWorkspaces.groovy
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
void performCleanup(node, items) {
for (item in items) {