Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F11012782
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
View Options
diff --git a/site-modules/profile/files/weekly_planning_bot/weekly-planning-bot b/site-modules/profile/files/weekly_planning_bot/weekly-planning-bot
index 64f84fe8..80ee3e35 100644
--- a/site-modules/profile/files/weekly_planning_bot/weekly-planning-bot
+++ b/site-modules/profile/files/weekly_planning_bot/weekly-planning-bot
@@ -1,41 +1,43 @@
#!/usr/bin/env bash
+set -e
+
DEST=swh-team@inria.fr
AUTHOR=swh-team@inria.fr
TEMPLATE_ID="6YKT5osoST-amJQ0MusH2Q"
URL="https://hedgedoc.softwareheritage.org"
DATE=`date +%G-W%V`
# Retrieve the template's content
-TEMPLATE=`http -pb "${URL}/${TEMPLATE_ID}/download"`
+TEMPLATE=`curl -s "${URL}/${TEMPLATE_ID}/download"`
TEMPLATE=$(echo "$TEMPLATE" | sed -e "s/\$DATE/$DATE/g")
# Create a new page initialized with the template content
-RESP=`http -ph POST "${URL}/new" content-type:text/markdown <<< "$TEMPLATE"`
-LOCATION=`echo "$RESP" | grep "Location:" | cut -c 11-`
+RESP=`curl -s -A POST -H "Content-Type: text/markdown" "${URL}/new" --data-binary "$TEMPLATE"`
+LOCATION=`echo "$RESP" | awk '{print $4}'`
if [ -n "$LOCATION" ] ; then
/usr/lib/sendmail -t <<EOF
From: Weekly planning bot <$AUTHOR>
To: $DEST
Subject: [Weekly Planning] Week $DATE
Beep boop, I'm a bot.
Here is the pad for the next weekly planning meeting:
$LOCATION
Please take a few minutes to pre-fill your part.
Remote attendees:
https://meet.jit.si/EquivalentCoincidencesVentureOnlySwhTeam
Yours faithfully,
--
The Software Heritage weekly bot
EOF
fi
diff --git a/site-modules/profile/manifests/weekly_planning_bot.pp b/site-modules/profile/manifests/weekly_planning_bot.pp
index f4261ff7..265e7569 100644
--- a/site-modules/profile/manifests/weekly_planning_bot.pp
+++ b/site-modules/profile/manifests/weekly_planning_bot.pp
@@ -1,30 +1,30 @@
# A bot creating a thread for people to prepare their weekly planning in the centralized
# weekly report hedgedoc document
class profile::weekly_planning_bot {
$command = '/usr/local/bin/weekly-planning-bot'
$weekly_planning_user = lookup('weekly_planning_bot::user')
$weekly_planning_cron = lookup('weekly_planning_bot::cron')
- $package = 'httpie';
+ $package = 'curl';
ensure_packages($package)
file {$command:
ensure => present,
mode => '0755',
owner => 'root',
group => 'root',
source => 'puppet:///modules/profile/weekly_planning_bot/weekly-planning-bot',
}
profile::cron::d {'weekly-planning-bot':
command => "chronic ${command}",
user => $weekly_planning_user,
* => $weekly_planning_cron,
require => [
File[$command],
Package[$package]
],
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Sep 18, 4:34 AM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3277072
Attached To
rSPSITE puppet-swh-site
Event Timeline
Log In to Comment