utilisation de clé redmine de l'utilisateur agirbot

This commit is contained in:
Romain H 2020-02-22 14:45:34 +01:00 committed by root
parent 48d648331c
commit b42764aa4e

View File

@ -1,9 +1,12 @@
#! /bin/bash
# Lecture configuration
CONFIG="/etc/drop.chapril.org/dropchaprilorg.conf"
source ${CONFIG}
# Lecture configuration drop
CONFIG_DROP="/etc/drop.chapril.org/dropchaprilorg.conf"
source ${CONFIG_DROP}
# Lecture configuration agirbot
CONFIG_AGIRBOT="/etc/chagirbot/agiraprilorg.conf"
source ${CONFIG_AGIRBOT}
main() {
post_report
@ -21,19 +24,19 @@ EOF
curl -s \
-H "Content-Type: application/json" \
-H "X-Redmine-API-Key: ${REDMINE_API_KEY}" \
-H "X-Redmine-API-Key: ${key}" \
-X PUT --data-binary "@${datafile}" \
"${REDMINE_BASE_URL}/issues/${REDMINE_TICKET_ID}.json"
rm "${datafile}"
}
last_comment_date() {
curl -H "X-Redmine-API-Key: ${REDMINE_API_KEY}" -s "${REDMINE_BASE_URL}/issues/${REDMINE_TICKET_ID}.json?include=journals" \
curl -H "X-Redmine-API-Key: ${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" \
curl -H "X-Redmine-API-Key: ${key}" -s "${REDMINE_BASE_URL}/issues/${REDMINE_TICKET_ID}.json?include=journals" \
| jq '.issue.journals[] | [.user.name, .notes]'
}