2020-11-12 00:53:52 +01:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
SCRIPT="/srv/forge.chapril.org/tools/rapport_activite/rapport_activite.sh"
|
2020-11-12 01:25:37 +01:00
|
|
|
source "/etc/chagirbot/chagirbot.conf"
|
|
|
|
source "/etc/forge.chapril.org/forgechaprilorg.conf"
|
2020-11-12 00:53:52 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
post_report()
|
|
|
|
{
|
|
|
|
curl -s \
|
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
-H "X-Redmine-API-Key: ${REDMINE_API_KEY}" \
|
2024-06-17 01:45:43 +02:00
|
|
|
-X PUT --data-binary "@-" \
|
|
|
|
"${REDMINE_BASE_URL}/issues/${REDMINE_TICKET_ID}.json" \
|
|
|
|
< <("$SCRIPT" -p | jq --raw-input --slurp '{ "issue": {"notes": .} }')
|
2020-11-12 00:53:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
last_comment_date()
|
|
|
|
{
|
|
|
|
curl -H "X-Redmine-API-Key: ${REDMINE_API_KEY}" -s "${REDMINE_BASE_URL}/issues/${REDMINE_TICKET_ID}.json?include=journals" \
|
|
|
|
| jq '.issue.journals | last | .created_on'
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
list()
|
|
|
|
{
|
|
|
|
curl -H "X-Redmine-API-Key: ${REDMINE_API_KEY}" -s "${REDMINE_BASE_URL}/issues/${REDMINE_TICKET_ID}.json?include=journals" \
|
|
|
|
| jq '.issue.journals[] | [.user.name, .notes]'
|
|
|
|
}
|
|
|
|
|
|
|
|
# Main.
|
|
|
|
post_report
|