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
task: notify-failed
config:
platform: linux
image_resource:
type: registry-image
source:
repository: badouralix/curl-jq
run:
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
resource_types:
- name: apprise
type: registry-image
source:
repository: git.pim.kunis.nl/pim/concourse-apprise-notifier
tag: 2f31a9abbbcdf29726e305cbf0702a581515f156eb5bfe09311a1232a941bb14
resources:
- name: site-repo
@ -41,6 +19,18 @@ resources:
username: pim
password: ((api_key))
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:
- 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
docker stack deploy --compose-file docker-stack.yml static
on_success:
<< : *notify-success
put: apprise-notification
params:
body: "Static website deployed!"
no_get: true
on_failure:
<< : *notify-failed