From 9947415ef06102e55c8ac07010a160a92a42242f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 3 May 2013 18:33:11 +0200 Subject: [PATCH] Remove Twitter notification support Turns out Twitter is not an ideal medium for sending build notifications :-) --- deps.nix | 1 - src/script/hydra-build | 38 -------------------------------------- 2 files changed, 39 deletions(-) diff --git a/deps.nix b/deps.nix index b6780a0e..9a931f87 100644 --- a/deps.nix +++ b/deps.nix @@ -24,7 +24,6 @@ with pkgs; perlPackages.IOCompress perlPackages.IPCRun perlPackages.JSONXS - perlPackages.NetTwitterLite perlPackages.PadWalker perlPackages.CatalystDevel perlPackages.Readonly diff --git a/src/script/hydra-build b/src/script/hydra-build index cbbad07f..5c17e652 100755 --- a/src/script/hydra-build +++ b/src/script/hydra-build @@ -17,7 +17,6 @@ use Sys::Hostname::Long; use Config::General; use Text::Table; use POSIX qw(strftime); -use Net::Twitter::Lite; use Data::Dump qw(dump); use feature qw/switch/; @@ -28,38 +27,6 @@ my $db = Hydra::Model::DB->new(); my $config = getHydraConfig(); -sub sendTwitterNotification { - my ($build) = @_; - - return unless (defined $ENV{'TWITTER_USER'} && defined $ENV{'TWITTER_PASS'}); - - my $addURL = defined $config->{'base_uri'}; - - my $jobName = $build->project->name . ":" . $build->jobset->name . ":" . $build->job->name; - my $status = $build->buildstatus == 0 ? "SUCCEEDED" : "FAILED"; - my $system = $build->system; - my $duration = ($build->stoptime - $build->starttime) . " seconds"; - my $url = $config->{'base_uri'}."/build/".$build->id ; - - my $nt = Net::Twitter::Lite->new( - username => $ENV{'TWITTER_USER'}, - password => $ENV{'TWITTER_PASS'}, - clientname => "Hydra Build Daemon" - ); - - my $tag = $build->project->name; - my $msg = "$jobName ($system): $status in $duration #$tag"; - if (length($msg) + 1 + length($url) <= 140) { - $msg = "$msg $url" ; - } - - eval { - my $result = eval { $nt->update($msg) }; - }; - warn "$@\n" if $@; -} - - sub statusDescription { my ($buildstatus) = @_; @@ -478,7 +445,6 @@ sub doBuild { }); sendEmailNotification $build; - sendTwitterNotification $build; } @@ -489,10 +455,6 @@ if ($ENV{'HYDRA_MAIL_TEST'}) { sendEmailNotification $db->resultset('Builds')->find($buildId); exit 0; } -if ($ENV{'HYDRA_TWITTER_TEST'}) { - sendTwitterNotification $db->resultset('Builds')->find($buildId); - exit 0; -} # Lock the build. If necessary, steal the lock from the parent # process (runner.pl). This is so that if the runner dies, the