pipeline fix v8

This commit is contained in:
2025-03-22 18:29:35 +01:00
parent 7688a60f5a
commit 274737b4d7

View File

@@ -112,14 +112,14 @@ jobs:
password: ${{ secrets.ALPINE_PASSWORD }}
script: |
VERSION=${{ env.VERSION }}
echo "Gekozen versie: $VERSION-SNAPSHOT"
echo "Gekozen versie: $VERSION"
# Stop en verwijder de huidige container
docker stop paypoint-backend || true
docker rm paypoint-backend || true
# Haal de nieuwste image binnen
docker pull veenm/paypoint-backend-jvm:$VERSION-SNAPSHOT
docker pull veenm/paypoint-backend-jvm:$VERSION
# Start een nieuwe container
docker run -d --name paypoint-backend --restart unless-stopped -p 15000:8080 \
@@ -135,6 +135,7 @@ jobs:
-e MAILER_PASSWORD=${{ secrets.MAILER_PASSWORD }} \
veenm/paypoint-backend-jvm:$VERSION
# Opruimen oude images
docker image prune -f
@@ -150,3 +151,23 @@ jobs:
"message": "@all ✅ *Build is geslaagd!* Versie '"$VERSION"' staat klaar op https://test-paypoint.melvanveen.nl"
}' \
https://mattermost.melvanveen.nl/api/v4/posts
notify-failure:
needs: [ build-and-push, deploy ]
runs-on: ubuntu-latest
if: failure()
steps:
- name: Notify Mattermost via Bot on failure
env:
MATTERMOST_BOT_TOKEN: ${{ secrets.MATTERMOST_BOT_TOKEN }}
REPO: ${{ gitea.repository }}
BRANCH: ${{ gitea.ref }}
run: |
curl --fail -X POST -H "Authorization: Bearer $MATTERMOST_BOT_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"channel_id": "9a8obynkd7rctk6qf8rfe6oppy",
"message": "@all ❌ *Build gefaald!* De pipeline is stukgelopen voor *'"$REPO"'* op branch *'"$BRANCH"'*."
}' \
https://mattermost.melvanveen.nl/api/v4/posts