rapport d'activité: le rapport généré n'est pas du JSON

This commit is contained in:
Pierre-Louis Bonicoli 2024-06-17 01:45:43 +02:00
parent 69286e36fd
commit 0c75469fec
Signed by: pilou
GPG Key ID: 06914C4A5EDAA6DD

View File

@ -7,21 +7,12 @@ source "/etc/forge.chapril.org/forgechaprilorg.conf"
#
post_report()
{
datafile=$(mktemp /tmp/report_stats_$(date +%Y-%m-%d_%H%M)_XXXX.json)
cat <<EOF > "${datafile}"
{
"issue": {
"notes": "$(/srv/forge.chapril.org/tools/rapport_activite/rapport_activite.sh -p | sed -z 's/\n/\\n/g')"
}
}
EOF
curl -s \
-H "Content-Type: application/json" \
-H "X-Redmine-API-Key: ${REDMINE_API_KEY}" \
-X PUT --data-binary "@${datafile}" \
"${REDMINE_BASE_URL}/issues/${REDMINE_TICKET_ID}.json"
rm "${datafile}"
-X PUT --data-binary "@-" \
"${REDMINE_BASE_URL}/issues/${REDMINE_TICKET_ID}.json" \
< <("$SCRIPT" -p | jq --raw-input --slurp '{ "issue": {"notes": .} }')
}
#