View gradle-vfs-plugin2.groovy
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 org.ysb33r.gradle.vfs.* | |
// Assuming we have properties in gradle.properties | |
// userNameFrom | |
// passwordFrom | |
// userNameTo | |
// passwordTo | |
task simpleCopyTask ( type : VfsCopy ) { | |
from 'ftp://${userNameFrom}:${passwordFrom}@from.here/a.txt' |
View vfs-plugins.groovy
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 org.ysb33r.groovy.dsl.vfs.VFS | |
def vfs = new VFS() | |
// --------------------------------- | |
// Adding new providers with schemes | |
// --------------------------------- | |
vfs { | |
extend { | |
// Adding provider with no external dependencies |
View bintray-examples.groovy
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
@Grab( 'org.codehaus.groovy.modules.http-builder:http-builder:0.5.2' ) | |
import groovyx.net.http.RESTClient | |
import groovyx.net.http.HttpResponseException | |
def repoOwner = 'ysb33r' | |
def repoName = 'grysb33r' | |
def packageName = 'bintray-gradle-plugin' | |
def bintrayUsername = '__YOUR_USERNAME__' | |
def bintrayApiKey = '__YOUR_APIKEY__' | |
def packageVersion = '0.1' |
View JenkinsBuildFlowGetSVNTrackingInfo.groovy
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
// Assumuing that the build flow tracks another job's SVN revision | |
// Get the SVN URLs and revisions | |
def svn=build.getAction(hudson.scm.RevisionParameterAction.class) | |
svn.revisions.each { | |
println it.SVNURL | |
println it.revision | |
} | |
// Get the Build number of the job being tracked |
View JenkinsBuildFlowObjects.groovy
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
// Given that you have kicked off a build according to the DSL syntax | |
def results = build('RUN_THIS_JOB') | |
// Get out the name of the job again | |
println results.name | |
// Get the build ID | |
println results.id | |
// Get the build URL |
View JenkinsBuildFlow.groovy
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 partitions=6 | |
def testResults | |
def buildResult | |
def staticAnalysisResult | |
def smokeTestResult | |
def performanceResult | |
def buildFlow= { buildResult= build( 'BUILDER' ) } | |
def performanceFlow= { performanceResult = build('PERFORMANCE')} |
View Example.groovy
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
class Example { | |
def hhg() { 42 } | |
} | |
View Download+Unpack.groovy
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
@Grapes([ | |
@GrabResolver( name='grysb33r', root='http://dl.bintray.com/ysb33r/grysb33r' ), | |
@Grab( 'org.ysb33r.groovy:groovy-vfs:0.2' ), | |
@Grab( 'commons-httpclient:commons-httpclient:3.1') | |
]) | |
import org.ysb33r.groovy.dsl.vfs.VFS | |
// This will download the compressed archive from Sourceforge and unpack it to a local directory | |
new VFS() { |
View RelativePath.groovy
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 root= new File('/usr/share') | |
def full= new File('/usr/share/docs/rpm-4.4') | |
// Print the relative path of 'full' in relation to 'root' | |
// Notice that the full path is passed as a parameter to the root. | |
def relPath= new File( root.toURI().relativize( full.toURI() ).toString() ) |
View XsltUnitToJUnitXml.xsl
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- ============================================================================ | |
(C) Copyright Schalk W. Cronjé 2013 | |
This code snippet is licensed under the Apache License 2.0 | |
See http://www.apache.org/licenses/LICENSE-2.0 for license details | |
============================================================================ --> | |
<xsl:transform | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1" |