use new apprise resource type

This commit is contained in:
Pim Kunis 2023-05-26 23:37:23 +02:00
parent bfff4fa67a
commit 0dc76a2743

View file

@ -1,32 +1,10 @@
--- ---
notify-failed: &notify-failed resource_types:
task: notify-failed - name: apprise
config:
platform: linux
image_resource:
type: registry-image type: registry-image
source: source:
repository: badouralix/curl-jq repository: git.pim.kunis.nl/pim/concourse-apprise-notifier
run: tag: 2f31a9abbbcdf29726e305cbf0702a581515f156eb5bfe09311a1232a941bb14
path: sh
args:
- -exc
- |
curl -X POST -d '{"body":"Deployment failed!"}' -H "Content-Type: application/json" https://apprise.pim.kunis.nl:444/notify/concourse
notify-success: &notify-success
task: notify-deployed
config:
platform: linux
image_resource:
type: registry-image
source:
repository: badouralix/curl-jq
run:
path: sh
args:
- -exc
- |
curl -X POST -d '{"body":"Static website deployed!"}' -H "Content-Type: application/json" https://apprise.pim.kunis.nl:444/notify/concourse
resources: resources:
- name: site-repo - name: site-repo
@ -41,6 +19,18 @@ resources:
username: pim username: pim
password: ((api_key)) password: ((api_key))
icon: docker icon: docker
- name: apprise-notification
type: apprise
source:
host: https://apprise.pim.kunis.nl:444
key: concourse
icon: bell
notify-failed: &notify-failed
put: apprise-notification
params:
body: "Failed to deploy static website!"
no_get: true
jobs: jobs:
- name: build-static-website - name: build-static-website
@ -171,6 +161,9 @@ jobs:
sed "s/TAG/$(cat site-registry-image/tag)/g" "site-repo/docker-stack.yml.template" > docker-stack.yml sed "s/TAG/$(cat site-registry-image/tag)/g" "site-repo/docker-stack.yml.template" > docker-stack.yml
docker stack deploy --compose-file docker-stack.yml static docker stack deploy --compose-file docker-stack.yml static
on_success: on_success:
<< : *notify-success put: apprise-notification
params:
body: "Static website deployed!"
no_get: true
on_failure: on_failure:
<< : *notify-failed << : *notify-failed