add version in apprise notification

This commit is contained in:
Pim Kunis 2023-06-14 21:44:56 +02:00
parent dddfc9e028
commit eeb42dc2b7

View file

@ -4,7 +4,7 @@ resource_types:
type: registry-image type: registry-image
source: source:
repository: git.pim.kunis.nl/pim/concourse-apprise-notifier repository: git.pim.kunis.nl/pim/concourse-apprise-notifier
tag: latest tag: "1.1"
resources: resources:
- name: site-repo - name: site-repo
@ -35,7 +35,7 @@ resources:
branch: version branch: version
file: version file: version
private_key: {{private_key}} private_key: {{private_key}}
icon: numberic icon: numeric
notify-failed: &notify-failed notify-failed: &notify-failed
put: apprise-notification put: apprise-notification
@ -99,7 +99,7 @@ jobs:
<< : *notify-failed << : *notify-failed
- get: version - get: version
params: params:
bump: minor bump: patch
- put: site-registry-image - put: site-registry-image
params: params:
image: image/image.tar image: image/image.tar
@ -111,10 +111,12 @@ jobs:
file: version/version file: version/version
- name: deploy-static-website - name: deploy-static-website
plan: plan:
- get: site-registry-image - get: version
trigger: true trigger: true
passed: [build-static-website] passed: [build-static-website]
- get: site-repo - get: site-repo
- get: site-registry-image
passed: [build-static-website]
- task: deploy-site - task: deploy-site
config: config:
platform: linux platform: linux
@ -127,6 +129,7 @@ jobs:
inputs: inputs:
- name: site-repo - name: site-repo
- name: site-registry-image - name: site-registry-image
- name: version
run: run:
path: sh path: sh
args: args:
@ -137,12 +140,14 @@ jobs:
cp site-repo/ssh_config $HOME/.ssh/config cp site-repo/ssh_config $HOME/.ssh/config
echo "((private_key))" > $HOME/.ssh/id_ed25519 echo "((private_key))" > $HOME/.ssh/id_ed25519
chmod 600 $HOME/.ssh/id_ed25519 chmod 600 $HOME/.ssh/id_ed25519
sed "s/TAG/((image_version))/g" "site-repo/docker-stack.yml.template" > docker-stack.yml sed "s/TAG/$(cat version/version)/g" "site-repo/docker-stack.yml.template" > docker-stack.yml
cat 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:
put: apprise-notification put: apprise-notification
params: params:
body: "Static website deployed!" title: "Static website deployed!"
body: "New version: $(cat version/version)"
no_get: true no_get: true
on_failure: on_failure:
<< : *notify-failed << : *notify-failed