diff --git a/.woodpecker/deploy.yml b/.woodpecker/deploy.yml index e8cd49d..f027b8c 100644 --- a/.woodpecker/deploy.yml +++ b/.woodpecker/deploy.yml @@ -45,6 +45,34 @@ steps: echo "All build attempts failed" exit 1 + - name: Send Docker Image Build Status Notification (success) + image: curlimages/curl + environment: + DISCORD_WEBHOOK_URL: + from_secret: discord_webhook_url + commands: + - | + BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Docker image build success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") + curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + depends_on: + - Docker image build + when: + - status: [ success ] + + - name: Send Docker Image Build Status Notification (failure) + image: curlimages/curl + environment: + DISCORD_WEBHOOK_URL: + from_secret: discord_webhook_url + commands: + - | + BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Docker image build failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") + curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + depends_on: + - Docker image build + when: + - status: [ failure ] + - name: Push to registry image: docker:latest environment: @@ -72,6 +100,34 @@ steps: depends_on: - Docker image build + - name: Send Push to Registry Status Notification (success) + image: curlimages/curl + environment: + DISCORD_WEBHOOK_URL: + from_secret: discord_webhook_url + commands: + - | + BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Push to registry success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") + curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + depends_on: + - Push to registry + when: + - status: [ success ] + + - name: Send Push to Registry Status Notification (failure) + image: curlimages/curl + environment: + DISCORD_WEBHOOK_URL: + from_secret: discord_webhook_url + commands: + - | + BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Push to registry failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") + curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + depends_on: + - Push to registry + when: + - status: [ failure ] + - name: Trigger Portainer stack redeploy image: curlimages/curl:latest environment: @@ -91,3 +147,31 @@ steps: echo "✓ Portainer redeploy triggered (HTTP $code)" depends_on: - Push to registry + + - name: Send Deploy Status Notification (success) + image: curlimages/curl + environment: + DISCORD_WEBHOOK_URL: + from_secret: discord_webhook_url + commands: + - | + BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Production Deploy success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") + curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + depends_on: + - Trigger Portainer stack redeploy + when: + - status: [ success ] + + - name: Send Deploy Status Notification (failure) + image: curlimages/curl + environment: + DISCORD_WEBHOOK_URL: + from_secret: discord_webhook_url + commands: + - | + BODY=$(printf '{"username":"WoodpeckerBot","content":"[%s - Build #%s] Production Deploy failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") + curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$DISCORD_WEBHOOK_URL" + depends_on: + - Trigger Portainer stack redeploy + when: + - status: [ failure ] diff --git a/test.txt b/test.txt deleted file mode 100644 index b6fc4c6..0000000 --- a/test.txt +++ /dev/null @@ -1 +0,0 @@ -hello \ No newline at end of file