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
require 'jenkins/plugin/behavior' | |
module Jenkins | |
# | |
# Defines the equivalent of `hudson.Extension` | |
# | |
module Extension | |
extend Plugin::Behavior | |
implemented do |cls| |
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.jruby.ext.posix.*; | |
import hudson.os.*; | |
class MyHandler implements POSIXHandler { | |
public void error(POSIX.ERRORS errors, String s) { | |
throw new PosixException(s,errors); | |
} | |
public void unimplementedError(String s) { | |
throw new UnsupportedOperationException(s); |
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
root@cucumber:/var/log/apache2/mirrors.jenkins-ci.org# mb scan -d updates ftp-nyc.osuosl.org | |
Tue Apr 10 01:24:03 2012 ftp-nyc.osuosl.org: starting | |
Tue Apr 10 01:24:03 2012 ftp-nyc.osuosl.org: files in 'updates' before scan: 33 | |
Tue Apr 10 01:24:04 2012 ftp-nyc.osuosl.org: scanned 33 files (25/s) in 1s | |
Tue Apr 10 01:24:04 2012 ftp-nyc.osuosl.org: files to be purged: 0 | |
Tue Apr 10 01:24:04 2012 ftp-nyc.osuosl.org: total files in 'updates' after scan: 33 (delta: 0) | |
Tue Apr 10 01:24:04 2012 ftp-nyc.osuosl.org: purged old files in 0s. | |
Tue Apr 10 01:24:04 2012 ftp-nyc.osuosl.org: done. | |
Completed in 1 seconds |
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
% git remote -v | |
origin ssh://git@git.cloudbees.com/cloudbees/jenkins-validated-merge-plugin.git (fetch) | |
origin ssh://git@git.cloudbees.com/cloudbees/jenkins-validated-merge-plugin.git (push) | |
[~/ws/cloudbees/jenkins-validated-merge-plugin@atlas] (master) | |
% git push origin | |
usage: gitosis-serve [OPTS] USER | |
gitosis-serve: error: Missing argument USER. | |
fatal: The remote end hung up unexpectedly |
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
ClassLoader old = Thread.currentThread().getContextClassLoader(); | |
Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); | |
try { | |
... call into Velocity ... | |
} finally { | |
Thread.currentThread().setContextClassLoader(old); | |
} |
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
% nmap -P0 -p 22 repo-internal.cloudbees.com | |
Starting Nmap 5.21 ( http://nmap.org ) at 2012-05-25 17:51 PDT | |
Nmap scan report for repo-internal.cloudbees.com (184.73.168.54) | |
Host is up. | |
rDNS record for 184.73.168.54: ec2-184-73-168-54.compute-1.amazonaws.com | |
PORT STATE SERVICE | |
22/tcp filtered ssh | |
Nmap done: 1 IP address (1 host up) scanned in 2.10 seconds |
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 Foo | |
def initialize | |
@x=10 | |
end | |
end | |
f = Foo.new | |
i = 1 | |
b = f.instance_eval do | |
# this binding can see all members of f (like @x) as well as variables in the outer sopce (like i) |
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
require 'cucumber/cli/main' | |
Cucumber::Cli::Main.new(['cucumber-test/features'],output,output).execute! |
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
"pool-3-thread-1" Id=33 Group=main TIMED_WAITING | |
at java.lang.Thread.sleep(Native Method) | |
at com.cloudbees.hudson.service.BaseRequest.poll(BaseRequest.java:70) | |
at com.cloudbees.hudson.service.AcquireSlaveRequest.acquire(AcquireSlaveRequest.java:90) | |
at com.cloudbees.hudson.service.ProvidoreSwarm.acquire(ProvidoreSwarm.java:77) | |
at com.cloudbees.hudson.plugins.SwarmCloud$1.call(SwarmCloud.java:105) | |
at com.cloudbees.hudson.plugins.SwarmCloud$1.call(SwarmCloud.java:97) |
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
public static String getActionUrl(String itUrl,Action action) { | |
String urlName = action.getUrlName(); | |
if(urlName==null) return null; // to avoid NPE and fail to render the whole page | |
if(SCHEME.matcher(urlName).find()) | |
return urlName; // absolute URL | |
if(urlName.startsWith("/")) | |
return joinPath(Stapler.getCurrentRequest().getContextPath(),urlName); | |
else | |
// relative URL name | |
return urlName; |