summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2012-11-20 00:27:19 +0100
committerHolger Levsen <holger@layer-acht.org>2012-11-20 00:27:19 +0100
commitfd972c12328219914e56a931c0e570df41744082 (patch)
treeae305c8524b5f60c0699017712302c955d9f5d4c
parent5deb7ac323b97755d1a3d85a87d0985f8d022c2a (diff)
downloadjenkins.debian.net-fd972c12328219914e56a931c0e570df41744082.tar.xz
enable irc notification kgb-bot and jenkins email plugin
-rwxr-xr-xbin/email2irc.sh56
-rw-r--r--etc/postfix/main.cf40
-rw-r--r--job-cfg/chroot-tests.yaml8
-rw-r--r--job-cfg/d-i.yaml10
-rwxr-xr-xprocmailrc3
-rwxr-xr-xupdate_jdn.sh3
6 files changed, 110 insertions, 10 deletions
diff --git a/bin/email2irc.sh b/bin/email2irc.sh
new file mode 100755
index 00000000..60382a3c
--- /dev/null
+++ b/bin/email2irc.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+#
+# FIXME: this needs cleanup soo much
+#
+
+HEADER=true
+VALID_MAIL=false
+FIRST_LINE=""
+while read line ; do
+ if [ "$HEADER" == "true" ] ; then
+ if [[ $line =~ ^$ ]] ; then
+ HEADER=false
+ fi
+ if [[ $line =~ ^(From: jenkins@jenkins.debian.net) ]] ; then
+ VALID_MAIL=true
+ fi
+ if [[ $line =~ ^(Subject: .*) ]] ; then
+ SUBJECT=${line:9}
+ fi
+ if [[ $line =~ ^(To: .*) ]] ; then
+ echo $line >> /var/lib/jenkins/email_log
+ CHANNEL=$(echo $line | cut -d "+" -f2| cut -d "@" -f1)
+ echo "CHANNEL = $CHANNEL" >> /var/lib/jenkins/email_log
+ echo >> /var/lib/jenkins/email_log
+ fi
+ if [[ $line =~ ^(X-Jenkins-Job: .*) ]] ; then
+ JENKINS_JOB=${line:15}
+ fi
+ fi
+ if [ "$HEADER" == "false" ] && [ -z "$FIRST_LINE" ] ; then
+ FIRST_LINE=$line
+ fi
+
+done
+if [ -z $JENKINS_JOB ] ; then
+ VALID_MAIL=false
+fi
+
+if [ "$VALID_MAIL" == "true" ] ; then
+ echo -e "----------\nvalid email\n-----------" >> /var/lib/jenkins/email_log
+ echo $JENKINS_JOB | cut -d ":" -f1 >> /var/lib/jenkins/email_log
+ SUBJECT=$(echo $SUBJECT | cut -d ":" -f1)
+ echo $SUBJECT >> /var/lib/jenkins/email_log
+ echo $FIRST_LINE >> /var/lib/jenkins/email_log
+ if [ ! -z $CHANNEL ] ; then
+ echo "#$CHANNEL: $SUBJECT. $FIRST_LINE" >> /var/lib/jenkins/email_log
+ kgb-client --conf /srv/jenkins/kgb/$CHANNEL.conf --relay-msg "$SUBJECT. $FIRST_LINE"
+ else
+ echo "But no irc channel detected." >> /var/lib/jenkins/email_log
+ fi
+else
+ echo -e "----------\nbad luck\n-----------" >> /var/lib/jenkins/email_log
+fi
+
+
diff --git a/etc/postfix/main.cf b/etc/postfix/main.cf
new file mode 100644
index 00000000..142c1b9a
--- /dev/null
+++ b/etc/postfix/main.cf
@@ -0,0 +1,40 @@
+# See /usr/share/postfix/main.cf.dist for a commented, more complete version
+
+
+# Debian specific: Specifying a file name will cause the first
+# line of that file to be used as the name. The Debian default
+# is /etc/mailname.
+#myorigin = /etc/mailname
+
+smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
+biff = no
+
+# appending .domain is the MUA's job.
+append_dot_mydomain = no
+
+# Uncomment the next line to generate "delayed mail" warnings
+#delay_warning_time = 4h
+
+readme_directory = no
+
+# TLS parameters
+smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
+smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
+smtpd_use_tls=yes
+smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
+smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
+
+# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
+# information on enabling SSL in the smtp client.
+
+myhostname = jenkins.debian.net
+alias_maps = hash:/etc/aliases
+alias_database = hash:/etc/aliases
+myorigin = /etc/mailname
+mydestination = jenkins.debian.net, localhost.debian.net, , localhost
+relayhost =
+mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
+mailbox_size_limit = 0
+recipient_delimiter = +
+inet_interfaces = all
+mailbox_command = /usr/bin/procmail -a "$EXTENSION" DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir
diff --git a/job-cfg/chroot-tests.yaml b/job-cfg/chroot-tests.yaml
index b8b034cc..882f548b 100644
--- a/job-cfg/chroot-tests.yaml
+++ b/job-cfg/chroot-tests.yaml
@@ -15,7 +15,7 @@
unstable_on_warning: 'false'
fail_on_error: 'false'
- email:
- recipients: holger@layer-acht.org
+ recipients: jenkins+debian-qa holger@layer-acht.org
properties:
- sidebar:
url: http://jenkins.debian.net/userContent/about.html
@@ -48,7 +48,7 @@
- trigger:
project: '{my_trigger}'
- email:
- recipients: holger@layer-acht.org
+ recipients: jenkins+debian-qa holger@layer-acht.org
properties:
- sidebar:
url: http://jenkins.debian.net/userContent/about.html
@@ -87,7 +87,7 @@
- trigger:
project: '{my_4th_trigger}'
- email:
- recipients: holger@layer-acht.org
+ recipients: jenkins+debian-qa holger@layer-acht.org
properties:
- sidebar:
url: http://jenkins.debian.net/userContent/about.html
@@ -122,7 +122,7 @@
- trigger:
project: '{my_3rd_trigger}'
- email:
- recipients: holger@layer-acht.org
+ recipients: jenkins+debian-qa holger@layer-acht.org
- job-template:
defaults: chroot-tests
diff --git a/job-cfg/d-i.yaml b/job-cfg/d-i.yaml
index b4f70d06..f040fb6d 100644
--- a/job-cfg/d-i.yaml
+++ b/job-cfg/d-i.yaml
@@ -70,7 +70,7 @@
indexfiles: ''
keepall: False
- email:
- recipients: holger@layer-acht.org
+ recipients: jenkins+debian-boot holger@layer-acht.org
- defaults:
name: d-i-manual-pdf
@@ -118,7 +118,7 @@
indexfiles: ''
keepall: False
- email:
- recipients: holger@layer-acht.org
+ recipients: jenkins+debian-boot holger@layer-acht.org
- defaults:
name: d-i-build
@@ -157,7 +157,7 @@
unstable_on_warning: 'true'
fail_on_error: 'true'
- email:
- recipients: holger@layer-acht.org
+ recipients: jenkins+debian-boot holger@layer-acht.org
- job-template:
defaults: d-i
@@ -180,7 +180,7 @@
- pollscm: "*/30 * * * *"
publishers:
- email:
- recipients: holger@layer-acht.org
+ recipients: jenkins+debian-boot holger@layer-acht.org
- job-template:
defaults: d-i
@@ -201,7 +201,7 @@
indexfiles: 'build-logs.html'
keepall: True
- email:
- recipients: holger@layer-acht.org
+ recipients: jenkins+debian-boot holger@layer-acht.org
- job-template:
defaults: d-i
diff --git a/procmailrc b/procmailrc
new file mode 100755
index 00000000..2e60d090
--- /dev/null
+++ b/procmailrc
@@ -0,0 +1,3 @@
+:0
+*From: jenkins@jenkins.debian.net
+| /srv/jenkins/bin/email2irc.sh
diff --git a/update_jdn.sh b/update_jdn.sh
index b8ccb26e..3216246e 100755
--- a/update_jdn.sh
+++ b/update_jdn.sh
@@ -25,7 +25,7 @@ done
#
sudo apt-get install vim screen less etckeeper moreutils curl mtr-tiny dstat devscripts bash-completion shorewall shorewall6 cron-apt apt-listchanges munin calamaris visitors \
build-essential python-setuptools \
- debootstrap sudo figlet graphviz apache2 python-yaml python-pip mr subversion subversion-tools vnstat webcheck
+ debootstrap sudo figlet graphviz apache2 python-yaml python-pip mr subversion subversion-tools vnstat webcheck procmail
explain "Packages installed."
#
@@ -53,6 +53,7 @@ explain "Packages configured."
#
cd $BASEDIR
cp -r bin logparse job-cfg /srv/jenkins/
+cp procmailrc /var/lib/jenkins/.procmailrc
explain "Jenkins updated."
cp -r README INSTALL TODO userContent/* /var/lib/jenkins/userContent/
cd /var/lib/jenkins/userContent/