Compare commits
	
		
			9 Commits
		
	
	
		
			1ee71fcc4e
			...
			master
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 7e6c871446 | |||
| f0d2746b71 | |||
| be7aa42d2a | |||
| 12598ec381 | |||
| f99aabb164 | |||
| d85767bdb1 | |||
| afdf818fe3 | |||
| 34f9c49d54 | |||
| 7a4220931c | 
@@ -26,3 +26,16 @@ pipeline:
 | 
			
		||||
        - "${CI_COMMIT_TAG}"
 | 
			
		||||
    when:
 | 
			
		||||
      event: [tag]
 | 
			
		||||
  
 | 
			
		||||
  notify:
 | 
			
		||||
    image: registry.t-juice.club/plugin-gotify
 | 
			
		||||
    pull: true
 | 
			
		||||
    settings:
 | 
			
		||||
      gotify_url: https://gotify.t-juice.club
 | 
			
		||||
      gotify_token:
 | 
			
		||||
        from_secret: gotify_token
 | 
			
		||||
      title: plugin-gotify updated
 | 
			
		||||
      message: latest update to ${CI_COMMIT_SHA:0:8}
 | 
			
		||||
    when:
 | 
			
		||||
      branch: master
 | 
			
		||||
      event: [push]
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
FROM alpine:latest
 | 
			
		||||
RUN apk add --no-cache curl
 | 
			
		||||
RUN apk add --no-cache curl jq
 | 
			
		||||
COPY entrypoint.sh /bin/entrypoint.sh
 | 
			
		||||
CMD ["/bin/entrypoint.sh"]
 | 
			
		||||
@@ -1,3 +1,5 @@
 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
# plugin-gotify
 | 
			
		||||
 | 
			
		||||
Plugin for woodpecker to send messages to gotify.
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,21 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
 | 
			
		||||
# TODO: Verify that variables are set properly
 | 
			
		||||
curl "${PLUGIN_GOTIFY_URL}/message?token=${PLUGIN_GOTIFY_TOKEN}" -F "title=${PLUGIN_TITLE}" -F "message=${PLUGIN_MESSAGE}" -F "priority=5"
 | 
			
		||||
if [ -z ${PLUGIN_GOTIFY_URL} ]; then 
 | 
			
		||||
    echo "PLUGIN_GOTIFY_URL is not set"; 
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [ -z ${PLUGIN_GOTIFY_TOKEN} ]; then 
 | 
			
		||||
    echo "PLUGIN_GOTIFY_TOKEN is not set"; 
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
OUTPUT_FILE=$(mktemp)
 | 
			
		||||
STATUS_CODE=$(curl -s --output "$OUTPUT_FILE" --write-out "%{http_code}" "${PLUGIN_GOTIFY_URL}/message?token=${PLUGIN_GOTIFY_TOKEN}" -F "title=${PLUGIN_TITLE}" -F "message=${PLUGIN_MESSAGE}" -F "priority=5")
 | 
			
		||||
if [ "$STATUS_CODE" -ne "200" ]; then
 | 
			
		||||
    echo "Failed to send message:"
 | 
			
		||||
    cat "$OUTPUT_FILE" | jq .
 | 
			
		||||
    exit 1
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
cat "$OUTPUT_FILE" | jq .
 | 
			
		||||
		Reference in New Issue
	
	Block a user