wp-telegram

command module
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 17 Imported by: 0

README

wp-telegram

logo

GoDoc codecov Go Report Card

Woodpecker plugin for sending telegram notifications.

Feature

  • Send with Text Message. (markdown or html format)
  • Send with New Photo.
  • Send with New Document.
  • Send with New Audio.
  • Send with New Voice.
  • Send with New Location.
  • Send with New Venue.
  • Send with New Video.
  • Send with New Sticker.

Build or Download a binary

The pre-compiled binaries can be downloaded from release page. Support the following OS type.

  • Windows amd64/386
  • Linux arm/amd64/386
  • Darwin amd64/386

With Go installed

go get -u -v github.com/m0rf30/wp-telegram

or build the binary with the following command:

export GOOS=linux
export GOARCH=amd64
export CGO_ENABLED=0
export GO111MODULE=on

go test -cover ./...

go build -v -a -tags netgo -o release/linux/amd64/wp-telegram .

Testing

Test the package with the following command:

make test

Usage

Execute from the working directory:

docker run --rm \
  -e PLUGIN_TOKEN=xxxxxxx \
  -e PLUGIN_TO=xxxxxxx \
  -e PLUGIN_MESSAGE=test \
  -e PLUGIN_MESSAGE_FILE=testmessage.md \  
  -e PLUGIN_PHOTO=tests/github.png \
  -e PLUGIN_DOCUMENT=tests/gophercolor.png \
  -e PLUGIN_STICKER=tests/github-logo.png \
  -e PLUGIN_AUDIO=tests/audio.mp3 \
  -e PLUGIN_VOICE=tests/voice.ogg \
  -e PLUGIN_LOCATION="24.9163213 121.1424972" \
  -e PLUGIN_VENUE="24.9163213 121.1424972 title address" \
  -e PLUGIN_VIDEO=tests/video.mp4 \
  -e PLUGIN_DEBUG=true \
  -e PLUGIN_ONLY_MATCH_EMAIL=false \
  -e PLUGIN_FORMAT=markdown \
  -e CI_REPO_OWNER=m0rf30 \
  -e CI_REPO_NAME=go-hello \
  -e CI_COMMIT_SHA=e5e82b5eb3737205c25955dcc3dcacc839b7be52 \
  -e CI_COMMIT_BRANCH=master \
  -e CI_PIPELINE_FORGE_URL=https://github.com/m0rf30/go-hello/compare/master... \
  -e CI_COMMIT_AUTHOR=m0rf30 \
  -e CI_COMMIT_AUTHOR_EMAIL=m0rf30@gmail.com \
  -e CI_PIPELINE_NUMBER=1 \
  -e CI_PIPELINE_STATUS=success \
  -e CI_PIPELINE_URL=http://github.com/m0rf30/go-hello \
  -e CI_COMMIT_TAG=1.0.0 \
  -e CI_PIPELINE_STARTED=1477550550 \
  -e CI_PIPELINE_FINISHED=1477550750 \
  -v $(pwd):$(pwd) \
  -w $(pwd) \
  m0rf30/wp-telegram

Load all environments from file.

docker run --rm \
  -e PLUGIN_ENV_FILE=your_env_file_path \
  -v $(pwd):$(pwd) \
  -w $(pwd) \
  m0rf30/wp-telegram

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL