Fixed update Redmine script.

This commit is contained in:
Christian P. MOMON 2021-03-06 01:38:58 +01:00 committed by root
parent dd90151005
commit 8d494feb91

View File

@ -0,0 +1,28 @@
#! /bin/bash
source "/etc/visio.chapril.org/visiochaprilorg.conf"
source "/etc/chagirbot/agiraprilorg.conf"
REDMINE_API_KEY="$key"
#
post_report()
{
datafile=$(mktemp /tmp/report_stats_$(date +%Y-%m-%d_%H%M)_XXXX.json)
cat <<EOF > "${datafile}"
{
"issue": {
"notes": "$(/srv/visio.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}"
}
# Main.
post_report