Use node-inspector to debug hubot!
sudo npm install -g node-inspector
coffee --nodejs --debug $(which hubot)
echo This is a test | |
pause |
#!/bin/bash | |
function check_fail { | |
if [[ $? -ne 0 ]]; then | |
echo "[FAIL] $1" | |
exit 1 | |
fi | |
} | |
# Check puppet information |
class dummyPackage { | |
package { 'yourpackagename': | |
ensure => installed|absent, | |
provider => dpkg, | |
source => '/path/to/file.deb', | |
} | |
} | |
class { 'dummyPackage': } |
#!/bin/sh | |
echo -e "deb http://apt.puppetlabs.com/ lucid main\ndeb-src http://apt.puppetlabs.com/ lucid main" >> /etc/apt/sources.list.d/puppet.list | |
apt-key adv --keyserver keyserver.ubuntu.com --recv 4BD6EC30 | |
apt-get update | |
apt-get install puppet |
Use node-inspector to debug hubot!
sudo npm install -g node-inspector
coffee --nodejs --debug $(which hubot)
use Data::Dumper; | |
$s = "1-19A"; | |
@a = $s =~ m/(\d+)\-(\d+)([A-Z])?/i; | |
print Dumper(@a) |
([regex]'\/([\w|\.]+)$').matches("http://somerandomwebsite.com/branches/4.8release")[0].Groups[1].Value |
sub versions { | |
my ($s) = @_; | |
# get a summary of the actions for this build (in some cases all versions will be the same) | |
my $sth = BS::db::action->db_Main->prepare(<<SQL); | |
select max(action_id) from actions where build_id = ? group by branch_id, revision, storm_branch_id, storm_revision, build_id; | |
SQL | |
$sth->execute($s->id); | |
return BS::db::action->sth_to_objects($sth); |
sub duplicateAction { | |
my ($s, $context) = @_; | |
my ($oldAction, $newAction) = eval { | |
# verify correct arguments specified | |
map { if(!exists($Form->{$_})) { die "invalid arguments"; } } qw(build type target); | |
BS::db::action->do_transaction(sub{ | |
my $actionType = BS::db::actionType->find_or_create( name => $Form->{type} ); | |
my $target = BS::db::target->find_or_create( name => $Form->{target} ); |