[wip] There should be a plugin approach for output
This commit is contained in:
parent
756cc3957a
commit
e77830a144
3 changed files with 52 additions and 18 deletions
15
hooks-output/changelog-server.sh
Normal file
15
hooks-output/changelog-server.sh
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
HOOKS_OUTPUT+=( hookOutputChangelogServer )
|
||||
|
||||
CHANGELOG_SERVER=http://localhost:3000
|
||||
|
||||
hookOutputChangelogServer(){
|
||||
|
||||
[[ -z "$1" ]] && echo "Sending changelog to remote server" && return
|
||||
CONTENT=$(jq -aRs . $1|tr '"' '\"')
|
||||
PAYLOAD="{\"author\":\"$CHANGELOG_USERNAME\",\"server\":\"$(hostname -f)\",\"content\":${CONTENT}}"
|
||||
URL=$( curl -X POST -H "Content-Type: application/json" -s -d "${PAYLOAD}" "$CHANGELOG_SERVER/changelog/_doc"; )
|
||||
echo "$FILE: $URL" >> $TMP
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue