This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hudson.scm.* | |
newURL = "https://mvld-dev1.hcuk.pri:18080/svn/dev/hccf/test_automation/functional/trunk/selenium-framework/hitachi-automation" | |
for (job in Hudson.instance.items) { | |
if (job.scm instanceof SubversionSCM) { | |
location = job.scm.locations[0] | |
println(location) | |
newLocation = new SubversionSCM.ModuleLocation(newURL, location.local) | |
newscm = new SubversionSCM([newLocation], job.scm.workspaceUpdater, job.scm.browser, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.cloudbees.hudson.plugins.folder.Folder | |
import hudson.FilePath | |
import jenkins.model.Jenkins | |
def boolean isFolder(String name) { | |
def item = Jenkins.instance.getItemByFullName(name) | |
return item instanceof Folder | |
} | |
def deleteUnusedWorkspace(FilePath root, String path) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<title>Build report</title> | |
<style type="text/css"> | |
body | |
{ | |
margin: 0px; | |
padding: 15px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does | |
import hudson.model.*; | |
import hudson.util.*; | |
import jenkins.model.*; | |
import hudson.FilePath.FileCallable; | |
import hudson.slaves.OfflineCause; | |
import hudson.node_monitors.*; | |
for (node in Jenkins.instance.nodes) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hudson.model.* | |
def env = build.getEnvironment() | |
def gitCommit = env['GIT_COMMIT'] | |
def shortGitCommit = gitCommit[0..6] | |
def pa = new ParametersAction([ | |
new StringParameterValue("SHORT_GIT_COMMIT", shortGitCommit) | |
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jenkins.instance.items.findAll {job-> | |
job.name.startsWith('<prefix-of-the-jobs>')//add the starting string - name of the job | |
}.each { | |
item -> | |
if (item.disabled == false) { | |
println item.name | |
item.disabled=true | |
item.save() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def projects = [ | |
"scala-nightly-checkinit", | |
"scala-nightly-main", | |
"scala-nightly-rangepos", | |
"scala-nightly-windows" | |
] | |
inst = jenkins.model.Jenkins.instance; | |
def oldVersion = "2.10.x" | |
def newVersion = "2.11.x" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.onresolve.jira.groovy.canned.workflow.postfunctions | |
import com.atlassian.jira.ComponentManager | |
import com.atlassian.jira.issue.Issue | |
import com.atlassian.jira.util.ErrorCollection | |
import com.onresolve.jira.groovy.canned.CannedScript | |
import com.onresolve.jira.groovy.canned.utils.CannedScriptUtils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setlocal enabledelayedexpansion | |
set REPOS=%1 | |
set TXN=%2 | |
set SVNLOOK="%VISUALSVN_SERVER%\bin\svnlook.exe" | |
SET M= | |
REM Concatenate all the lines in the commit message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.json.JsonSlurper; | |
import hudson.model.*; | |
def jiraUrl = "https://${url}/rest/api/2/project/${project}/versions/"; | |
def conn = jiraUrl.toURL().openConnection(); | |
def authString = "${user}:${password}".getBytes().encodeBase64().toString() | |
conn.setRequestProperty("Authorization", "Basic ${authString}"); | |
if( conn.responseCode == 200 ) { | |
def versions = new JsonSlurper().parseText(conn.content.text); |