Commit 1cb20b68 authored by Fardale's avatar Fardale

Improvement of CI. Send mail to the possible author of the bug.

parent 438dfd68
...@@ -7,6 +7,7 @@ import smtplib, argparse ...@@ -7,6 +7,7 @@ import smtplib, argparse
from email.mime.text import MIMEText from email.mime.text import MIMEText
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("mail", help="mail of the receiver")
parser.add_argument("filename", help="file containing the corp of the mail") parser.add_argument("filename", help="file containing the corp of the mail")
args = parser.parse_args() args = parser.parse_args()
...@@ -14,10 +15,11 @@ with open(args.filename) as fp: ...@@ -14,10 +15,11 @@ with open(args.filename) as fp:
# Create a text/plain message # Create a text/plain message
msg = MIMEText(fp.read()) msg = MIMEText(fp.read())
msg['Subject'] = 'Continuous Integration of the the_dungeon_project : Error'
msg['From'] = 'the_dungeon_project@ci.org' msg['From'] = 'the_dungeon_project@ci.org'
msg['To'] = args.mail
msg['Reply-To'] = 'ens-info-genielog-2015@lists.crans.org' msg['Reply-To'] = 'ens-info-genielog-2015@lists.crans.org'
msg['To'] = 'ens-info-genielog-2015@lists.crans.org' msg['Subject'] = 'Continuous Integration of the the_dungeon_project : Error'
# Send the message via our own SMTP server. # Send the message via our own SMTP server.
s = smtplib.SMTP('smtp.crans.org') s = smtplib.SMTP('smtp.crans.org')
......
...@@ -6,12 +6,20 @@ make clean ...@@ -6,12 +6,20 @@ make clean
if ! make; then if ! make; then
echo 'Compilation error in the master branch.' > CI/msg echo 'Compilation error in the master branch.' > CI/msg
echo 'Result of make :\n' >> CI/msg echo 'Result of make :\n' >> CI/msg
make 2>> CI/msg make 2>> CI/msgerror
cat CI/msgerror >> CI/msg
echo '\n-- \nCI script' >> CI/msg echo '\n-- \nCI script' >> CI/msg
# Kludge : pas de serveur smtp accessible depuis la salle. # Kludge : pas de serveur smtp accessible depuis la salle.
scp CI/msg fardale@acerarien.crans.org:the_dungeon_project/ scp CI/msg fardale@crash-test.crans.org:the_dungeon_project/
ssh fardale@acerarien.crans.org './the_dungeon_project/mailci.py ./the_dungeon_project/msg' ssh fardale@crash-test.crans.org './the_dungeon_project/mailci.py "ens-info-genielog-2015@lists.crans.org" ./the_dungeon_project/msg'
rm -f CI/msg rm -f CI/msg
echo 'It seems that your commit breaks the compilation of the project.' > CI/msg
echo 'Result of make :\n' >> CI/msg
cat CI/msgerror >> CI/msg
echo '\n-- \nCI script' >> CI/msg
# Kludge : pas de serveur smtp accessible depuis la salle.
scp CI/msg fardale@crash-test.crans.org:the_dungeon_project/
ssh fardale@crash-test.crans.org "./the_dungeon_project/mailci.py $(git log -n 1 | grep Author | sed "s/.*<\(.*\)>/\1/g") ./the_dungeon_project/msg"
fi fi
exit 0 exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment