Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
Please comment & let me know if you have a fork / fixes you'd like to include.
| using System; | |
| using System.Collections.ObjectModel; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Reflection; | |
| using System.Web.Http; | |
| using System.Web.Http.Controllers; | |
| using System.Web.Http.Description; | |
| using System.Web.Http.Routing; | 
Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
Please comment & let me know if you have a fork / fixes you'd like to include.
| <?xml version="1.0" encoding="utf-16"?> | |
| <Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> | |
| <TypePattern DisplayName="COM interfaces" Priority="2000"> | |
| <TypePattern.Match> | |
| <And> | |
| <Kind Is="Interface" /> | |
| <Or> | |
| <HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" /> | |
| <HasAttribute Name="System.Runtime.InteropServices.ComImport" /> | |
| </Or> | 
| @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin | |
| <?xml version="1.0" encoding="utf-8"?> | |
| <packages> | |
| <package id="googlechrome " /> | |
| <package id="notepadplusplus.install"/> | |
| <package id="githubforwindows"/> | |
| <package id="javaruntime"/> | |
| <package id="7zip.install"/> | |
| <package id="adobereader"/> | 
| // HttpClient and how to use Headers, Content-Type and PostAsync | |
| // http://d-fens.ch/2014/04/12/httpclient-and-how-to-use-headers-content-type-and-postasync/ | |
| // Copyright 2014-2015 Ronald Rink, d-fens GmbH | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // http://www.apache.org/licenses/LICENSE-2.0 | 
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
| // When using the Promoted Build plugin, you may want to perform some operations | |
| // then you may also want to add badges or a summary to the target build as | |
| // opposed to the promotion build. This script assumes that you have a manual | |
| // promotion process with a parameter called RELEASE_VERSION (hence requiring | |
| // user input); the content that follows would be what you put as a Groovy | |
| // Postbuild action on the promotion process. | |
| import org.jvnet.hudson.plugins.groovypostbuild.*; | |
| def add_release_version(promotion) { | 
| using System; | |
| using System.Reactive.Linq; | |
| using System.Threading; | |
| /// <summary> | |
| /// Helper methods for using observable <see cref="IProgress{T}"/> implementations. These are hot observables. | |
| /// </summary> | |
| public static class ObservableProgress | |
| { | |
| /// <summary> | 
| function Search-ItemsRecursive($projectItems, $list){ | |
| ForEach ($item in $projectItems) { | |
| $itemName = $item.Name | |
| Write-Host "Getting all project items for $itemName" | |
| $list.Add($item); | |
| if($item.ProjectItems -ne $null){ | |
| Search-ItemsRecursive -projectItems $item.ProjectItems -list $list | |
| } | |
| if($item.SubProject -ne $null -and $item.SubProject.ProjectItems -ne $null){ | |
| Search-ItemsRecursive -projectItems $item.SubProject.ProjectItems -list $list |