diff --git a/.gitea/workflows/deploy-mainnet.yml b/.gitea/workflows/deploy-mainnet.yml index 639c5e7f..9675894e 100644 --- a/.gitea/workflows/deploy-mainnet.yml +++ b/.gitea/workflows/deploy-mainnet.yml @@ -232,16 +232,6 @@ jobs: echo "✅ Monitoring verification passed" - - name: Send deployment notification - run: | - cd /var/lib/aitbc-workspaces/post-deployment/repo - - # Send notification about mainnet deployment - STATUS=${{ needs.deploy-mainnet.result }} - bash scripts/notifications/send-deployment-notification.sh mainnet $STATUS - - echo "✅ Deployment notification sent" - - name: Cleanup if: always() run: rm -rf /var/lib/aitbc-workspaces/post-deployment diff --git a/.gitea/workflows/deploy-testnet.yml b/.gitea/workflows/deploy-testnet.yml index f5d8c3b9..edf09740 100644 --- a/.gitea/workflows/deploy-testnet.yml +++ b/.gitea/workflows/deploy-testnet.yml @@ -130,36 +130,3 @@ jobs: - name: Cleanup if: always() run: rm -rf /var/lib/aitbc-workspaces/deploy-testnet - - notify-deployment: - runs-on: debian - needs: deploy-testnet - if: always() - - steps: - - name: Clone repository - run: | - WORKSPACE="/var/lib/aitbc-workspaces/notify-deployment" - rm -rf "$WORKSPACE" - mkdir -p "$WORKSPACE" - cd "$WORKSPACE" - git clone --depth 1 http://gitea.bubuit.net:3000/oib/aitbc.git repo - - - name: Initialize job logging - run: | - cd /var/lib/aitbc-workspaces/notify-deployment/repo - bash scripts/ci/setup-job-logging.sh - - - name: Send deployment notification - run: | - cd /var/lib/aitbc-workspaces/notify-deployment/repo - - # Send notification about deployment status - STATUS=${{ needs.deploy-testnet.result }} - bash scripts/notifications/send-deployment-notification.sh testnet $STATUS - - echo "✅ Deployment notification sent" - - - name: Cleanup - if: always() - run: rm -rf /var/lib/aitbc-workspaces/notify-deployment diff --git a/scripts/notifications/send-deployment-notification.sh b/scripts/notifications/send-deployment-notification.sh deleted file mode 100755 index 5348c671..00000000 --- a/scripts/notifications/send-deployment-notification.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -# Send deployment notifications to configured channels - -set -e - -NETWORK="${1:-testnet}" -STATUS="${2:-success}" -REPO_DIR="/opt/aitbc" - -echo "=== Sending deployment notification for ${NETWORK} ===" - -# Load notification configuration -if [[ -f "${REPO_DIR}/scripts/notifications/config.sh" ]]; then - source "${REPO_DIR}/scripts/notifications/config.sh" -else - echo "⚠️ Notification config not found, using defaults" -fi - -# Prepare notification message -if [[ "$STATUS" == "success" ]]; then - EMOJI="✅" - COLOR="good" - MESSAGE="Deployment to ${NETWORK} completed successfully" -elif [[ "$STATUS" == "failure" ]]; then - EMOJI="❌" - COLOR="danger" - MESSAGE="Deployment to ${NETWORK} failed" -else - EMOJI="⚠️" - COLOR="warning" - MESSAGE="Deployment to ${NETWORK} had issues" -fi - -# Send Slack notification if configured -if [[ -n "${SLACK_WEBHOOK_URL}" ]]; then - curl -X POST "${SLACK_WEBHOOK_URL}" \ - -H 'Content-Type: application/json' \ - -d "{ - \"text\": \"${EMOJI} ${MESSAGE}\", - \"attachments\": [{ - \"color\": \"${COLOR}\", - \"fields\": [ - { - \"title\": \"Network\", - \"value\": \"${NETWORK}\", - \"short\": true - }, - { - \"title\": \"Status\", - \"value\": \"${STATUS}\", - \"short\": true - }, - { - \"title\": \"Timestamp\", - \"value\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\", - \"short\": true - } - ] - }] - }" - echo "✅ Slack notification sent" -else - echo "⚠️ Slack webhook not configured" -fi - -# Send email notification if configured -if [[ -n "${ALERT_EMAIL}" ]] && command -v mail &> /dev/null; then - echo "${EMOJI} ${MESSAGE} - -Network: ${NETWORK} -Status: ${STATUS} -Timestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)" | mail -s "AITBC Deployment: ${NETWORK} - ${STATUS}" "${ALERT_EMAIL}" - echo "✅ Email notification sent" -else - echo "⚠️ Email notification not configured" -fi - -echo "=== Deployment notification sent ==="