a docker container which runs the gotify-cli
2.4K
a docker container which runs the gotify-cli
Build against pinned upstream release
$ docker build -t visibilityspots/gotify-cli:latest .
$ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
$ docker buildx build -t visibilityspots/gotify-cli:latest --platform linux/amd64,linux/arm/v6,linux/arm/v7 --push .
fetch your gotify token from the config file created by gotify initialization which you could perform on your local machine or from within a docker container.
cat cli.json
{
"token": "BAR",
"url": "FOO",
"defaultPriority": 0
}
$ docker run --name gotify-cli --rm visibilityspots/gotify-cli:latest help
$ docker run --rm -v "$PWD/cli.json:/home/gotify/cli.json" visibilityspots/gotify-cli:latest push -p 5 "Test from Gotify CLI latest build"
I wrote some tests in a goss.yaml file which can be executed by dgoss to test the created image
$ dgoss run visibilityspots/gotify-cli push -t 'TEST' --token BAR --url=https://FOO test bericht
INFO: Starting docker container
INFO: Container ID: fcab7a6a
INFO: Sleeping for 0.2
INFO: Container health
INFO: Running Tests
User: gotify: exists: matches expectation: [true]
Command: gotify --version: exit-status: matches expectation: [0]
Command: gotify --version: stdout: matches expectation: [Version: v2.2.3 Commit: bbbd6e6638c00881c4a410256ea5f4511f063f5c BuildDate: April 2024]
Total Duration: 0.007s
Count: 3, Failed: 0, Skipped: 0
INFO: Deleting container
using act for local testing of the written github actions makes my life and commit history a lot easier;
$ act -l
Stage Job ID Job name Workflow name Workflow file Events
0 update update docker-hub-description docker-hub-description.yml push
0 test test CI main.yaml push
0 scan scan trivy trivy.yml push,pull_request,schedule
1 deploy deploy CI main.yaml push
$ act -j test
[CI/test] 🚀 Start image=catthehacker/ubuntu:act-latest
.
.
.
[CI/test] ✅ Success - Main Execute Goss tests
[CI/test] 🏁 Job succeeded
Distributed under the MIT license
Content type
Image
Digest
sha256:39880136a…
Size
12.1 MB
Last updated
about 1 year ago
docker pull visibilityspots/gotify-cli