Skip to content

first

first #8

name: Demo - Azure Infrastructure Deployment Pipeline
on:
push:
branches: [ main, develop, demo ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
environment:
description: 'Target Environment'
required: true
default: 'development'
type: choice
options:
- development
- staging
- production
simulate_failure:
description: 'Simulate a failure (for demo purposes)'
required: false
default: 'none'
type: choice
options:
- none
- jira
- change_request
- terraform
- post_deploy
jobs:
check-jira:
name: ๐ŸŽซ Check Jira
runs-on: ubuntu-latest
outputs:
jira_issue_id: ${{ steps.get-issue.outputs.issue_id }}
finops_story_id: ${{ steps.get-finops-story.outputs.story_id }}
finops_tags: ${{ steps.get-finops-tags.outputs.tags }}
steps:
- name: ๐Ÿ“ฅ Checkout code
uses: actions/checkout@v4
- name: ๐Ÿ” Simulate Jira API Failure
if: inputs.simulate_failure == 'jira'
run: |
echo "โŒ Simulating Jira API connection failure..."
exit 1
- name: ๐ŸŽฏ Get FinOpsStory Details
id: get-issue
run: |
echo "๐Ÿ” Extracting Jira issue from commit message..."
sleep 2
# Simulate extracting issue from commit
ISSUE_KEY="FINOPS-$(shuf -i 100-999 -n 1)"
echo "issue_id=${ISSUE_KEY}" >> $GITHUB_OUTPUT
echo "โœ… Found Jira Issue: ${ISSUE_KEY}"
- name: ๐Ÿท๏ธ Get Child FinOps Tag Story ID
id: get-finops-story
run: |
echo "๐Ÿ” Querying Jira for child FinOps stories..."
sleep 2
# Simulate finding child story
PARENT="${{ steps.get-issue.outputs.issue_id }}"
CHILD_STORY="${PARENT}-FINOPS"
echo "story_id=${CHILD_STORY}" >> $GITHUB_OUTPUT
echo "โœ… Found FinOps Story: ${CHILD_STORY}"
- name: ๐Ÿ“‹ Get ChildStory Details
run: |
echo "๐Ÿ“„ Fetching detailed story information from Jira..."
echo " - Story Points: 5"
echo " - Sprint: Infrastructure Q1"
echo " - Assignee: Platform Team"
sleep 1
- name: ๐Ÿท๏ธ Get FinOps Tags
id: get-finops-tags
run: |
echo "๐Ÿท๏ธ Extracting FinOps tags from Jira custom fields..."
sleep 2
# Simulate tag extraction
TAGS_JSON=$(jq -n \
--arg env "${{ inputs.environment || 'development' }}" \
'{
"CostCenter": "IT-001",
"ProjectCode": "FINOPS-2024",
"Department": "Platform-Engineering",
"Environment": $env,
"Owner": "platform-team@company.com",
"Purpose": "Demo-Pipeline"
}')
# Use delimiter to handle multiline output safely
echo "tags<<EOF" >> $GITHUB_OUTPUT
echo "$TAGS_JSON" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "โœ… FinOps Tags collected:"
echo "$TAGS_JSON" | jq .
- name: ๐Ÿข Check IIC Project Status
id: check-iic
run: |
echo "๐Ÿ” Checking if this is an IIC project..."
# Simulate IIC project detection (check commit message or project code)
COMMIT_MSG="${{ github.event.head_commit.message || 'demo commit' }}"
if [[ "$COMMIT_MSG" == *"IIC"* ]] || [[ "${{ needs.check-jira.outputs.jira_issue_id }}" == *"IIC"* ]]; then
echo "is_iic=true" >> $GITHUB_OUTPUT
echo "โœ… IIC project detected"
else
echo "is_iic=false" >> $GITHUB_OUTPUT
echo "โ„น๏ธ Not an IIC project"
fi
- name: ๐Ÿข Get Additional IIC Tags
if: steps.check-iic.outputs.is_iic == 'true'
run: |
echo "๐Ÿท๏ธ Adding IIC-specific tags..."
echo " ๐Ÿ“‹ Compliance Level: High"
echo " ๐Ÿ”’ Security Classification: Restricted"
echo " ๐Ÿ“Š Audit Required: Yes"
echo "โœ… IIC tags configured"
release-variables-setup:
name: ๐Ÿ”ง Release Variables Setup
runs-on: ubuntu-latest
needs: check-jira
outputs:
resource_group_name: ${{ steps.generate-names.outputs.resource_group_name }}
naming_prefix: ${{ steps.generate-names.outputs.naming_prefix }}
vm_names: ${{ steps.generate-vm-names.outputs.vm_names }}
timestamp: ${{ steps.generate-names.outputs.timestamp }}
steps:
- name: ๐Ÿท๏ธ Generate Azure Names
id: generate-names
run: |
echo "๐ŸŽฏ Generating standardized Azure resource names..."
# Generate demo names
TIMESTAMP=$(date +%Y%m%d%H%M%S)
ENV_SHORT="${{ inputs.environment || 'dev' }}"
ENV_SHORT=${ENV_SHORT:0:3}
NAMING_PREFIX="demo-${ENV_SHORT}-${TIMESTAMP:0:8}"
RG_NAME="rg-${NAMING_PREFIX}"
echo "resource_group_name=${RG_NAME}" >> $GITHUB_OUTPUT
echo "naming_prefix=${NAMING_PREFIX}" >> $GITHUB_OUTPUT
echo "timestamp=${TIMESTAMP}" >> $GITHUB_OUTPUT
echo "โœ… Generated naming convention:"
echo " ๐Ÿ“ Resource Group: ${RG_NAME}"
echo " ๐Ÿท๏ธ Naming Prefix: ${NAMING_PREFIX}"
sleep 1
- name: ๐Ÿ–ฅ๏ธ Generate Bastion VM Name
id: generate-bastion
run: |
PREFIX="${{ steps.generate-names.outputs.naming_prefix }}"
BASTION_NAME="vm-bastion-${PREFIX}"
echo "bastion_name=${BASTION_NAME}" >> $GITHUB_OUTPUT
echo "โœ… Bastion VM: ${BASTION_NAME}"
- name: ๐ŸŒ Generate Web VM Name(s)
id: generate-web
run: |
echo "๐Ÿ–ฅ๏ธ Generating Web VM names..."
PREFIX="${{ steps.generate-names.outputs.naming_prefix }}"
WEB_NAMES=()
for i in {1..3}; do
NAME="vm-web-${PREFIX}-${i}"
WEB_NAMES+=("${NAME}")
echo " โœ“ ${NAME}"
done
WEB_JSON=$(printf '%s\n' "${WEB_NAMES[@]}" | jq -R . | jq -s .)
echo "web_names<<EOF" >> $GITHUB_OUTPUT
echo "$WEB_JSON" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: ๐Ÿ“ฑ Generate App VM Name(s)
id: generate-app
run: |
echo "๐Ÿ–ฅ๏ธ Generating App VM names..."
PREFIX="${{ steps.generate-names.outputs.naming_prefix }}"
APP_NAMES=()
for i in {1..2}; do
NAME="vm-app-${PREFIX}-${i}"
APP_NAMES+=("${NAME}")
echo " โœ“ ${NAME}"
done
APP_JSON=$(printf '%s\n' "${APP_NAMES[@]}" | jq -R . | jq -s .)
echo "app_names<<EOF" >> $GITHUB_OUTPUT
echo "$APP_JSON" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: ๐Ÿ—„๏ธ Generate DB VM Name(s) - Windows
id: generate-db-win
run: |
PREFIX="${{ steps.generate-names.outputs.naming_prefix }}"
DB_WIN_NAME="vm-db-win-${PREFIX}"
echo "db_win_name=${DB_WIN_NAME}" >> $GITHUB_OUTPUT
echo "โœ… Windows DB VM: ${DB_WIN_NAME}"
- name: ๐Ÿง Generate DB VM Name(s) - Linux
id: generate-db-linux
run: |
PREFIX="${{ steps.generate-names.outputs.naming_prefix }}"
DB_LINUX_NAME="vm-db-linux-${PREFIX}"
echo "db_linux_name=${DB_LINUX_NAME}" >> $GITHUB_OUTPUT
echo "โœ… Linux DB VM: ${DB_LINUX_NAME}"
- name: ๐Ÿ“‹ Add Credentials (Compile VM Names)
id: generate-vm-names
run: |
echo "๐Ÿ“‹ Compiling all VM names..."
# Create a simple JSON structure without complex jq operations
cat > vm-inventory.json << EOF
{
"bastion": "${{ steps.generate-bastion.outputs.bastion_name }}",
"web": [
"vm-web-${{ steps.generate-names.outputs.naming_prefix }}-1",
"vm-web-${{ steps.generate-names.outputs.naming_prefix }}-2",
"vm-web-${{ steps.generate-names.outputs.naming_prefix }}-3"
],
"app": [
"vm-app-${{ steps.generate-names.outputs.naming_prefix }}-1",
"vm-app-${{ steps.generate-names.outputs.naming_prefix }}-2"
],
"db_windows": "${{ steps.generate-db-win.outputs.db_win_name }}",
"db_linux": "${{ steps.generate-db-linux.outputs.db_linux_name }}"
}
EOF
VM_NAMES=$(cat vm-inventory.json)
# Use delimiter for multiline JSON output
echo "vm_names<<EOF" >> $GITHUB_OUTPUT
echo "$VM_NAMES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "โœ… VM inventory compiled successfully"
sleep 1
standard-charge-creation:
name: ๐Ÿ“ Standard Charge Creation
runs-on: ubuntu-latest
needs: [check-jira, release-variables-setup]
outputs:
change_request_id: ${{ steps.create-cr.outputs.cr_number }}
steps:
- name: ๐Ÿ“‹ Create and Start Standard CR
id: create-cr
run: |
echo "๐Ÿ“ Creating Standard Change Request in ServiceNow..."
echo " ๐Ÿ“„ Type: Standard"
echo " ๐Ÿ“‹ Category: Infrastructure"
echo " ๐ŸŽฏ Risk: Low"
sleep 3
# Generate demo CR number
CR_NUMBER="CR-$(date +%Y%m%d)-$(shuf -i 1000-9999 -n 1)"
echo "โœ… Created Change Request: ${CR_NUMBER}"
echo " ๐Ÿ“ Status: Draft"
echo " ๐Ÿ‘ค Assigned to: CAB Team"
echo " ๐Ÿ“… Implementation Window: Next 2 hours"
echo "cr_number=${CR_NUMBER}" >> $GITHUB_OUTPUT
- name: โณ Wait for CR to Start
run: |
echo "โณ Waiting for Change Request approval..."
echo " ๐Ÿ”„ Polling ServiceNow API..."
# Simulate approval process
for i in {1..5}; do
echo " โฑ๏ธ Checking approval status... (${i}/5)"
sleep 2
done
if [[ "${{ inputs.simulate_failure }}" == "change_request" ]]; then
echo "โŒ Change Request rejected by CAB"
exit 1
fi
echo "โœ… Change Request approved!"
echo " โœ“ Approved by: CAB-AUTO"
echo " โœ“ Implementation can proceed"
build-azure-vms:
name: ๐Ÿ–ฅ๏ธ Deploy Azure VMs
runs-on: ubuntu-latest
needs: [check-jira, release-variables-setup, standard-charge-creation]
steps:
- name: ๐Ÿ“ฅ Checkout code
uses: actions/checkout@v4
- name: ๐Ÿ”ง Setup Terraform
run: |
echo "๐Ÿ“ฆ Installing Terraform v1.5.0..."
echo "โœ… Terraform installed successfully"
- name: ๐Ÿ” Azure Login
run: |
echo "๐Ÿ” Authenticating with Azure..."
echo " ๐Ÿ”‘ Using Service Principal"
echo " ๐Ÿ“ Subscription: Demo-Subscription"
echo "โœ… Successfully authenticated to Azure"
sleep 1
- name: ๐Ÿ”„ Terraform Init
run: |
echo "๐Ÿ”„ Initializing Terraform..."
echo " ๐Ÿ“ Working directory: ./terraform"
echo " ๐Ÿช Backend: Azure Storage Account"
sleep 2
echo "โœ… Terraform initialized successfully"
- name: ๐Ÿ” Terraform Validate
run: |
echo "๐Ÿ” Validating Terraform configuration..."
echo " ๐Ÿ“‹ Checking syntax and structure"
echo " ๐Ÿ”ง Validating provider configurations"
sleep 2
echo "โœ… Terraform configuration is valid"
- name: ๐Ÿ“‹ Terraform Plan
run: |
echo "๐Ÿ“‹ Creating Terraform execution plan..."
echo " ๐ŸŽฏ Target Environment: ${{ inputs.environment || 'development' }}"
echo " ๐Ÿ“Š Analyzing current state vs desired state"
sleep 3
echo ""
echo "๐Ÿ“Š Plan Summary:"
echo " โž• 25 resources to add"
echo " ๐Ÿ”„ 0 resources to change"
echo " โž– 0 resources to destroy"
echo ""
echo "โœ… Terraform plan completed successfully"
- name: ๐Ÿš€ Terraform Apply - Deploy Azure Resources
run: |
echo "๐Ÿš€ Starting Terraform Apply..."
echo ""
echo "๐Ÿ“‹ Deployment Configuration:"
echo " ๐Ÿ“ Resource Group: ${{ needs.release-variables-setup.outputs.resource_group_name }}"
echo " ๐Ÿ“ Region: East US"
echo " ๐Ÿท๏ธ Tags: ${{ needs.check-jira.outputs.finops_tags }}"
echo ""
if [[ "${{ inputs.simulate_failure }}" == "terraform" ]]; then
echo "โŒ Terraform apply failed!"
echo "Error: Error creating Virtual Machine: Code=\"OperationNotAllowed\""
exit 1
fi
echo "๐Ÿ—๏ธ Executing Terraform apply..."
echo ""
# Step 1: Create Resource Group
echo "๐Ÿ“ Creating Resource Group..."
echo " โœ“ azurerm_resource_group.main"
sleep 1
# Step 2: Create Virtual Network & Subnets
echo ""
echo "๐ŸŒ Creating Virtual Network & Subnets..."
echo " โœ“ azurerm_virtual_network.main (10.0.0.0/16)"
echo " โœ“ azurerm_subnet.bastion (10.0.1.0/24)"
echo " โœ“ azurerm_subnet.web (10.0.2.0/24)"
echo " โœ“ azurerm_subnet.app (10.0.3.0/24)"
echo " โœ“ azurerm_subnet.db (10.0.4.0/24)"
sleep 2
# Step 3: Create Network Security Groups
echo ""
echo "๐Ÿ”’ Creating Network Security Groups & Rules..."
echo " โœ“ azurerm_network_security_group.bastion (SSH: 22)"
echo " โœ“ azurerm_network_security_group.web (HTTP: 80, HTTPS: 443)"
echo " โœ“ azurerm_network_security_group.app (Internal: 8080)"
echo " โœ“ azurerm_network_security_group.db (SQL: 1433, MySQL: 3306)"
sleep 2
# Step 4: Create Bastion Host
echo ""
echo "๐Ÿฐ Creating Bastion Host..."
echo " โœ“ azurerm_public_ip.bastion"
echo " โœ“ azurerm_network_interface.bastion"
echo " โœ“ azurerm_linux_virtual_machine.bastion (Standard_B2s)"
sleep 1
# Step 5: Create Web Tier VMs
echo ""
echo "๐ŸŒ Creating Web Tier (3 VMs)..."
echo " โœ“ azurerm_availability_set.web"
echo " โœ“ azurerm_linux_virtual_machine.web[0] (Standard_B2s)"
echo " โœ“ azurerm_linux_virtual_machine.web[1] (Standard_B2s)"
echo " โœ“ azurerm_linux_virtual_machine.web[2] (Standard_B2s)"
sleep 2
# Step 6: Create App Tier VMs
echo ""
echo "๐Ÿ“ฑ Creating App Tier (2 VMs)..."
echo " โœ“ azurerm_availability_set.app"
echo " โœ“ azurerm_linux_virtual_machine.app[0] (Standard_B4ms)"
echo " โœ“ azurerm_linux_virtual_machine.app[1] (Standard_B4ms)"
sleep 1
# Step 7: Create Database VMs
echo ""
echo "๐Ÿ’พ Creating Database Tier (2 VMs)..."
echo " โœ“ azurerm_windows_virtual_machine.db_windows (Standard_D4s_v3)"
echo " โœ“ azurerm_linux_virtual_machine.db_linux (Standard_D4s_v3)"
sleep 1
# Step 8: Create Key Vault
echo ""
echo "๐Ÿ” Creating Key Vault & Secrets..."
echo " โœ“ azurerm_key_vault.main"
echo " โœ“ azurerm_key_vault_secret.ssh_key"
echo " โœ“ azurerm_key_vault_secret.admin_password"
sleep 1
# Step 9: Apply FinOps Tags
echo ""
echo "๐Ÿท๏ธ Applying FinOps Tags to All Resources..."
echo " โœ“ CostCenter: IT-001"
echo " โœ“ ProjectCode: FINOPS-2024"
echo " โœ“ Department: Platform-Engineering"
echo " โœ“ Environment: ${{ inputs.environment || 'development' }}"
echo " โœ“ Owner: platform-team@company.com"
echo " โœ“ Purpose: Demo-Pipeline"
sleep 2
echo ""
echo "โœ… All Azure Resources deployed successfully!"
echo ""
echo "๐Ÿ“Š Infrastructure Deployment Summary:"
echo " โœ“ 1 Resource Group"
echo " โœ“ 1 Virtual Network with 4 Subnets"
echo " โœ“ 4 Network Security Groups"
echo " โœ“ 1 Bastion Host (Public IP: 20.42.$(shuf -i 1-255 -n 1).$(shuf -i 1-255 -n 1))"
echo " โœ“ 3 Web Servers (Load Balanced)"
echo " โœ“ 2 App Servers (High Availability)"
echo " โœ“ 2 Database Servers (Windows + Linux)"
echo " โœ“ 1 Key Vault (Credentials Secured)"
echo " โœ“ All resources tagged for FinOps compliance"
- name: ๐Ÿ“Š Generate Deployment Report
if: always()
run: |
echo "๐Ÿ“Š Generating deployment report..."
cat > deployment-report.md << EOF
# ๐Ÿ“Š Deployment Report
## Summary
- **Date**: $(date)
- **Pipeline Run**: #${{ github.run_number }}
- **Triggered By**: ${{ github.actor }}
- **Environment**: ${{ inputs.environment || 'development' }}
## Change Management
- **Jira Issue**: ${{ needs.check-jira.outputs.jira_issue_id }}
- **Change Request**: ${{ needs.standard-charge-creation.outputs.change_request_id }}
- **FinOps Story**: ${{ needs.check-jira.outputs.finops_story_id }}
## Infrastructure Deployed
- **Resource Group**: ${{ needs.release-variables-setup.outputs.resource_group_name }}
- **Region**: East US
- **Virtual Machines**: 8 total (1 Bastion, 3 Web, 2 App, 2 DB)
- **Deployment Status**: ${{ job.status }}
## Cost Estimation
- **Monthly Estimate**: \$2,450
- **Daily Estimate**: \$82
## Next Steps
1. Verify application deployment
2. Configure monitoring alerts
3. Update DNS records
4. Schedule penetration testing
EOF
echo "โœ… Report generated: deployment-report.md"
- name: ๐Ÿ“ค Upload Deployment Report
if: always()
uses: actions/upload-artifact@v4
with:
name: deployment-report-azure-vms
path: deployment-report.md
build-sql-databases:
name: ๐Ÿ’พ Install SQL Databases
runs-on: ubuntu-latest
needs: [check-jira, release-variables-setup, standard-charge-creation]
steps:
- name: ๐Ÿ’พ Install SQL DB on Azure VMs
run: |
echo "๐Ÿ’พ Installing SQL Database on Azure VMs..."
echo ""
echo "๐ŸชŸ Windows SQL Server:"
echo " โ„น๏ธ SQL Server 2022 pre-installed with image"
echo " โœ“ Configuring SQL Server settings..."
sleep 2
echo " โœ“ Creating demo database..."
sleep 1
echo " โœ“ Setting up backup schedule..."
sleep 1
echo " โœ… Windows SQL Server ready!"
echo ""
echo "๐Ÿง Linux MySQL Server:"
echo " ๐Ÿ“ฆ Installing MySQL Server..."
sleep 2
echo " โœ“ MySQL 8.0 installed"
echo " โœ“ Configuring MySQL settings..."
sleep 1
echo " โœ“ Creating demo database..."
sleep 1
echo " โœ“ Setting up replication..."
sleep 1
echo " โœ… Linux MySQL Server ready!"
echo ""
echo "โœ… All database servers configured successfully!"
- name: ๐Ÿ“Š Generate Database Report
if: always()
run: |
echo "๐Ÿ“Š Generating database installation report..."
cat > database-report.md << EOF
# ๐Ÿ’พ Database Installation Report
## Summary
- **Date**: $(date)
- **Pipeline Run**: #${{ github.run_number }}
- **Environment**: ${{ inputs.environment || 'development' }}
## Database Servers Configured
- **Windows SQL Server 2022**: Ready
- **Linux MySQL 8.0**: Ready
- **Backup Configuration**: Enabled
- **Replication Setup**: Active
## Configuration Details
- **SQL Server Port**: 1433
- **MySQL Port**: 3306
- **High Availability**: Configured
- **Security**: SSL Enabled
## Next Steps
1. Configure application connections
2. Set up monitoring dashboards
3. Schedule maintenance windows
4. Verify backup procedures
EOF
echo "โœ… Database report generated"
- name: ๐Ÿ“ค Upload Database Report
if: always()
uses: actions/upload-artifact@v4
with:
name: deployment-report-sql-databases
path: database-report.md
post-deployment:
name: ๐Ÿ“ฎ Post Deployment Tasks
runs-on: ubuntu-latest
needs: [build-azure-vms, build-sql-databases, check-jira, release-variables-setup, standard-charge-creation]
if: always()
steps:
- name: ๐ŸŽซ Update Jira
run: |
echo "๐ŸŽซ Updating Jira ticket..."
echo " ๐Ÿ“ Issue: ${{ needs.check-jira.outputs.jira_issue_id }}"
# Check if both build jobs succeeded
VM_STATUS="${{ needs.build-azure-vms.result }}"
DB_STATUS="${{ needs.build-sql-databases.result }}"
if [[ "$VM_STATUS" == "success" && "$DB_STATUS" == "success" ]]; then
STATUS="success"
else
STATUS="failure"
fi
if [[ "$STATUS" == "success" ]]; then
echo " โœ… Adding success comment to Jira"
echo " ๐Ÿ“Ž Attaching deployment report"
echo " ๐Ÿท๏ธ Updating status: In Progress โ†’ Done"
else
echo " โŒ Adding failure comment to Jira"
echo " ๐Ÿ“Ž Attaching error logs"
echo " ๐Ÿท๏ธ Status remains: In Progress"
fi
sleep 2
echo "โœ… Jira updated successfully"
- name: ๐Ÿ“ข Send Notifications
run: |
echo "๐Ÿ“ข Sending deployment notifications..."
# Check if both build jobs succeeded
VM_STATUS="${{ needs.build-azure-vms.result }}"
DB_STATUS="${{ needs.build-sql-databases.result }}"
if [[ "$VM_STATUS" == "success" && "$DB_STATUS" == "success" ]]; then
STATUS="success"
else
STATUS="failure"
fi
STATUS_EMOJI=$([ "$STATUS" == "success" ] && echo "โœ…" || echo "โŒ")
echo ""
echo "๐Ÿ“ง Email Notification:"
echo " To: platform-team@company.com"
echo " Subject: ${STATUS_EMOJI} Deployment $STATUS - ${{ needs.check-jira.outputs.jira_issue_id }}"
echo ""
echo "๐Ÿ’ฌ Slack Notification:"
echo " Channel: #infrastructure-alerts"
echo " Message: ${STATUS_EMOJI} Azure deployment $STATUS"
echo ""
echo "๐Ÿ“Š Microsoft Teams:"
echo " Channel: Platform Engineering"
echo " Card: Deployment Summary with interactive buttons"
if [[ "${{ inputs.simulate_failure }}" == "post_deploy" ]]; then
echo ""
echo "โŒ Failed to send notifications!"
exit 1
fi
sleep 2
echo ""
echo "โœ… All notifications sent successfully"
- name: ๐Ÿ“ Close Change Request
run: |
echo "๐Ÿ“ Closing Change Request..."
echo " ๐Ÿ“‹ CR: ${{ needs.standard-charge-creation.outputs.change_request_id }}"
# Check if both build jobs succeeded
VM_STATUS="${{ needs.build-azure-vms.result }}"
DB_STATUS="${{ needs.build-sql-databases.result }}"
if [[ "$VM_STATUS" == "success" && "$DB_STATUS" == "success" ]]; then
STATUS="success"
else
STATUS="failure"
fi
if [[ "$STATUS" == "success" ]]; then
echo " โœ… Closing as: Successful"
echo " ๐Ÿ“„ Close notes: Deployment completed without issues"
else
echo " โŒ Closing as: Failed"
echo " ๐Ÿ“„ Close notes: Deployment failed - see GitHub Actions logs"
fi
sleep 2
echo "โœ… Change Request closed"
- name: ๐Ÿ“Š Final Summary
if: always()
run: |
echo ""
echo "========================================="
echo "๐Ÿ“Š PIPELINE EXECUTION SUMMARY"
echo "========================================="
echo ""
echo "Pipeline: ${{ needs.build.result == 'success' && 'โœ… SUCCESS' || 'โŒ FAILED' }}"
echo ""
echo "Stages Completed:"
echo " ${{ needs.check-jira.result == 'success' && 'โœ…' || 'โŒ' }} Jira Validation"
echo " ${{ needs.release-variables-setup.result == 'success' && 'โœ…' || 'โŒ' }} Variable Setup"
echo " ${{ needs.standard-charge-creation.result == 'success' && 'โœ…' || 'โŒ' }} Change Management"
echo " ${{ needs.build.result == 'success' && 'โœ…' || 'โŒ' }} Infrastructure Build"
echo " ${{ job.status == 'success' && 'โœ…' || 'โŒ' }} Post Deployment"
echo ""
echo "Total Duration: ~5 minutes (demo)"
echo "========================================="