Remove deployment notification steps and script from CI workflows
All checks were successful
All checks were successful
Delete send-deployment-notification.sh script and remove notification job from deploy-testnet.yml and notification step from deploy-mainnet.yml post-deployment job
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ==="
|
||||
Reference in New Issue
Block a user