rapport d'activité: le rapport généré n'est pas du JSON
This commit is contained in:
parent
69286e36fd
commit
0c75469fec
@ -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": .} }')
|
||||
}
|
||||
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user