From a509e4603e1c6789bc9ac256e7b4e6db1e417ab2 Mon Sep 17 00:00:00 2001 From: Greg Date: Tue, 1 Jul 2025 12:42:05 -0700 Subject: [PATCH] Remove custom domain testing from workflows - Remove all custom domain SSL testing and health checks - Use only canonical Knative domains for all testing - Update all workflows to use domain secrets for health checks - Remove kubectl dependencies from deployment workflows - Update index.html to v2.0.2 for testing canonical domain workflow - Simplify smoke tests to focus on Knative canonical domains only - Clean up auto-promotion summaries to remove SSL references All workflows now test only the canonical Knative domains and avoid custom domain complexity for a cleaner, more reliable pipeline. --- .github/workflows/auto-promote.yml | 38 +++++---------------- .github/workflows/deploy-dev.yml | 3 +- .github/workflows/deploy-prod.yml | 2 +- .github/workflows/deploy-staging.yml | 2 +- .github/workflows/promote-to-production.yml | 34 +++++++++--------- .github/workflows/smoke-test.yml | 28 +++++++++------ src/index.html | 2 +- 7 files changed, 48 insertions(+), 61 deletions(-) diff --git a/.github/workflows/auto-promote.yml b/.github/workflows/auto-promote.yml index cec02ed..7cd9f9e 100644 --- a/.github/workflows/auto-promote.yml +++ b/.github/workflows/auto-promote.yml @@ -11,6 +11,7 @@ jobs: test-and-promote-to-staging: name: Test Dev and Auto-Promote to Staging runs-on: ubuntu-latest + environment: development if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: @@ -28,40 +29,20 @@ jobs: run: | echo "๐Ÿงช Running comprehensive tests on dev environment..." - # Test canonical domain first (primary test) - echo "Testing canonical domain: game-2048-dev.game-2048-dev.dev.wa.darknex.us" - canonical_response=$(curl -s -o /dev/null -w "%{http_code}" -L --max-time 30 https://game-2048-dev.game-2048-dev.dev.wa.darknex.us/) + # Use the canonical Knative domain + CANONICAL_URL="https://game-2048-dev.game-2048-dev.${{ secrets.DEV_DOMAIN }}" + echo "Testing canonical domain: $CANONICAL_URL" + + canonical_response=$(curl -s -o /dev/null -w "%{http_code}" -L --max-time 30 "$CANONICAL_URL") if [ "$canonical_response" != "200" ]; then echo "โŒ Canonical domain returned HTTP $canonical_response" exit 1 fi echo "โœ… Canonical domain accessible" - # Test SSL certificate on custom domain - echo "Testing SSL certificate on custom domain..." - cert_expiry=$(echo | openssl s_client -servername 2048-dev.wa.darknex.us -connect 2048-dev.wa.darknex.us:443 2>/dev/null | openssl x509 -noout -enddate | cut -d= -f2) - expiry_epoch=$(date -d "$cert_expiry" +%s) - current_epoch=$(date +%s) - days_until_expiry=$(( (expiry_epoch - current_epoch) / 86400 )) - - if [ $days_until_expiry -lt 30 ]; then - echo "โŒ SSL certificate expires in less than 30 days!" - exit 1 - fi - echo "โœ… SSL certificate valid for $days_until_expiry days" - - # Test custom domain accessibility - echo "Testing custom domain accessibility..." - response_code=$(curl -s -o /dev/null -w "%{http_code}" -L --max-time 30 https://2048-dev.wa.darknex.us/) - if [ "$response_code" != "200" ]; then - echo "โŒ Custom domain returned HTTP $response_code" - exit 1 - fi - echo "โœ… Custom domain accessible" - # Test content validation on canonical domain echo "Testing content validation on canonical domain..." - content=$(curl -s -L --max-time 30 https://game-2048-dev.game-2048-dev.dev.wa.darknex.us/) + content=$(curl -s -L --max-time 30 "$CANONICAL_URL") if ! echo "$content" | grep -q "2048"; then echo "โŒ Content missing 2048 title" @@ -87,7 +68,7 @@ jobs: # Test performance on canonical domain echo "Testing performance on canonical domain..." - response_time=$(curl -s -o /dev/null -w "%{time_total}" -L --max-time 30 https://game-2048-dev.game-2048-dev.dev.wa.darknex.us/) + response_time=$(curl -s -o /dev/null -w "%{time_total}" -L --max-time 30 "$CANONICAL_URL") if (( $(echo "$response_time > 10.0" | bc -l) )); then echo "โŒ Response time too slow: ${response_time}s" exit 1 @@ -134,8 +115,7 @@ jobs: echo "| Staging Deploy | โณ Triggered | Deployment will start automatically |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### ๐Ÿ“‹ Tests Performed" >> $GITHUB_STEP_SUMMARY - echo "- SSL certificate validation" >> $GITHUB_STEP_SUMMARY - echo "- Domain accessibility check" >> $GITHUB_STEP_SUMMARY + echo "- Canonical domain accessibility check" >> $GITHUB_STEP_SUMMARY echo "- Content and functionality validation" >> $GITHUB_STEP_SUMMARY echo "- Performance testing" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index 0f1c902..4e97fa9 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -96,8 +96,7 @@ jobs: MAX_RETRIES=10 RETRY_COUNT=0 - # Get the canonical Knative domain for health check - # Format: service-name.namespace.knative-domain + # Use the canonical Knative domain for health check HEALTH_URL="https://game-2048-dev.game-2048-dev.${{ secrets.DEV_DOMAIN }}" while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index c2ee868..5f0035e 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -116,7 +116,7 @@ jobs: MAX_RETRIES=10 RETRY_COUNT=0 - # Get the canonical Knative domain for health check + # Use the canonical Knative domain for health check HEALTH_URL="https://game-2048-prod.game-2048-prod.${{ secrets.PROD_DOMAIN }}" while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index f471d55..406604d 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -93,7 +93,7 @@ jobs: MAX_RETRIES=10 RETRY_COUNT=0 - # Get the canonical Knative domain for health check + # Use the canonical Knative domain for health check HEALTH_URL="https://game-2048-staging.game-2048-staging.${{ secrets.STAGING_DOMAIN }}" while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do diff --git a/.github/workflows/promote-to-production.yml b/.github/workflows/promote-to-production.yml index 0f9fedb..1cb7d83 100644 --- a/.github/workflows/promote-to-production.yml +++ b/.github/workflows/promote-to-production.yml @@ -11,6 +11,7 @@ jobs: test-staging-and-promote-to-main: name: Test Staging and Promote to Main runs-on: ubuntu-latest + environment: staging if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: @@ -28,27 +29,20 @@ jobs: run: | echo "๐Ÿงช Running comprehensive tests on staging environment..." - # Test canonical staging domain first (primary test) - echo "Testing canonical staging domain: game-2048-staging.game-2048-staging.staging.wa.darknex.us" - canonical_response=$(curl -s -o /dev/null -w "%{http_code}" -L --max-time 30 https://game-2048-staging.game-2048-staging.staging.wa.darknex.us/) + # Use the canonical Knative domain for staging + CANONICAL_URL="https://game-2048-staging.game-2048-staging.${{ secrets.STAGING_DOMAIN }}" + echo "Testing canonical staging domain: $CANONICAL_URL" + + canonical_response=$(curl -s -o /dev/null -w "%{http_code}" -L --max-time 30 "$CANONICAL_URL") if [ "$canonical_response" != "200" ]; then echo "โŒ Staging canonical domain returned HTTP $canonical_response" exit 1 fi echo "โœ… Staging canonical domain accessible" - # Test custom staging domain - echo "Testing custom staging domain: 2048-staging.wa.darknex.us" - response_code=$(curl -s -o /dev/null -w "%{http_code}" -L --max-time 30 https://2048-staging.wa.darknex.us/) - if [ "$response_code" != "200" ]; then - echo "โŒ Staging custom domain returned HTTP $response_code" - exit 1 - fi - echo "โœ… Staging custom domain accessible" - # Test staging content validation on canonical domain echo "Testing staging content validation..." - content=$(curl -s -L --max-time 30 https://game-2048-staging.game-2048-staging.staging.wa.darknex.us/) + content=$(curl -s -L --max-time 30 "$CANONICAL_URL") if ! echo "$content" | grep -q "2048"; then echo "โŒ Content missing 2048 title" @@ -74,7 +68,7 @@ jobs: # Test staging performance on canonical domain echo "Testing staging performance..." - response_time=$(curl -s -o /dev/null -w "%{time_total}" -L --max-time 30 https://game-2048-staging.game-2048-staging.staging.wa.darknex.us/) + response_time=$(curl -s -o /dev/null -w "%{time_total}" -L --max-time 30 "$CANONICAL_URL") if (( $(echo "$response_time > 10.0" | bc -l) )); then echo "โŒ Response time too slow: ${response_time}s" exit 1 @@ -127,9 +121,15 @@ jobs: echo "- Performance testing" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### ๐ŸŽฎ Deployment Status" >> $GITHUB_STEP_SUMMARY - echo "- **Development**: โœ… Live at https://game-2048-dev.game-2048-dev.dev.wa.darknex.us" >> $GITHUB_STEP_SUMMARY - echo "- **Staging**: โœ… Live at https://game-2048-staging.game-2048-staging.staging.wa.darknex.us" >> $GITHUB_STEP_SUMMARY - echo "- **Production**: ๐Ÿš€ Deploying to https://game-2048-prod.game-2048-prod.wa.darknex.us" >> $GITHUB_STEP_SUMMARY + + # Use canonical domain format (these are the Knative domains) + DEV_URL="https://game-2048-dev.game-2048-dev.dev.wa.darknex.us" + STAGING_URL="https://game-2048-staging.game-2048-staging.staging.wa.darknex.us" + PROD_URL="https://game-2048-prod.game-2048-prod.wa.darknex.us" + + echo "- **Development**: โœ… Live at $DEV_URL" >> $GITHUB_STEP_SUMMARY + echo "- **Staging**: โœ… Live at $STAGING_URL" >> $GITHUB_STEP_SUMMARY + echo "- **Production**: ๐Ÿš€ Deploying to $PROD_URL" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### ๐Ÿ”— Next Steps" >> $GITHUB_STEP_SUMMARY echo "- Production deployment will start automatically" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 3a5a41c..7386f07 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -43,15 +43,15 @@ jobs: run: | case "${{ matrix.environment }}" in dev) - echo "CANONICAL_DOMAIN=game-2048-dev.game-2048-dev.dev.wa.darknex.us" >> $GITHUB_ENV + echo "CANONICAL_DOMAIN=https://game-2048-dev.game-2048-dev.dev.wa.darknex.us" >> $GITHUB_ENV echo "ENV_NAME=development" >> $GITHUB_ENV ;; staging) - echo "CANONICAL_DOMAIN=game-2048-staging.game-2048-staging.staging.wa.darknex.us" >> $GITHUB_ENV + echo "CANONICAL_DOMAIN=https://game-2048-staging.game-2048-staging.staging.wa.darknex.us" >> $GITHUB_ENV echo "ENV_NAME=staging" >> $GITHUB_ENV ;; prod) - echo "CANONICAL_DOMAIN=game-2048-prod.game-2048-prod.wa.darknex.us" >> $GITHUB_ENV + echo "CANONICAL_DOMAIN=https://game-2048-prod.game-2048-prod.wa.darknex.us" >> $GITHUB_ENV echo "ENV_NAME=production" >> $GITHUB_ENV ;; esac @@ -61,7 +61,7 @@ jobs: echo "๐ŸŽฏ Testing canonical Knative domain: ${{ env.CANONICAL_DOMAIN }}" # Test HTTPS access to canonical domain - response_code=$(curl -s -o /dev/null -w "%{http_code}" -L --max-time 30 https://${{ env.CANONICAL_DOMAIN }}/) + response_code=$(curl -s -o /dev/null -w "%{http_code}" -L --max-time 30 "${{ env.CANONICAL_DOMAIN }}") echo "Canonical domain HTTP response code: $response_code" if [ "$response_code" != "200" ]; then @@ -76,7 +76,7 @@ jobs: echo "๐Ÿ“„ Testing content validation on canonical domain: ${{ env.CANONICAL_DOMAIN }}" # Download the page content from canonical domain - content=$(curl -s -L --max-time 30 https://${{ env.CANONICAL_DOMAIN }}/) + content=$(curl -s -L --max-time 30 "${{ env.CANONICAL_DOMAIN }}") # Check if it contains expected 2048 game elements if echo "$content" | grep -q "2048"; then @@ -120,7 +120,7 @@ jobs: echo "โšก Testing performance for canonical domain: ${{ env.CANONICAL_DOMAIN }}" # Measure response time on canonical domain - response_time=$(curl -s -o /dev/null -w "%{time_total}" -L --max-time 30 https://${{ env.CANONICAL_DOMAIN }}/) + response_time=$(curl -s -o /dev/null -w "%{time_total}" -L --max-time 30 "${{ env.CANONICAL_DOMAIN }}") echo "Canonical domain response time: ${response_time}s" # Check if response time is reasonable (under 10 seconds) @@ -131,7 +131,7 @@ jobs: fi # Check content size - content_size=$(curl -s -L --max-time 30 https://${{ env.CANONICAL_DOMAIN }}/ | wc -c) + content_size=$(curl -s -L --max-time 30 "${{ env.CANONICAL_DOMAIN }}" | wc -c) echo "Content size: $content_size bytes" if [ $content_size -gt 1000 ]; then @@ -154,6 +154,7 @@ jobs: run: | echo "๐ŸŒ Testing canonical domain DNS resolution" + # Canonical domains (Knative domains only) canonical_domains=( "game-2048-dev.game-2048-dev.dev.wa.darknex.us" "game-2048-staging.game-2048-staging.staging.wa.darknex.us" @@ -175,6 +176,7 @@ jobs: run: | echo "๐Ÿ” Testing SSL certificate chains for canonical domains" + # Canonical domains (Knative domains only) canonical_domains=( "game-2048-dev.game-2048-dev.dev.wa.darknex.us" "game-2048-staging.game-2048-staging.staging.wa.darknex.us" @@ -226,6 +228,12 @@ jobs: echo "| Canonical Domain Tests | ${{ needs.test-canonical-domains.result == 'success' && 'โœ… Passed' || 'โŒ Failed' }} |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "### Tested Canonical Domains" >> $GITHUB_STEP_SUMMARY - echo "- ๐Ÿงช Development: https://game-2048-dev.game-2048-dev.dev.wa.darknex.us" >> $GITHUB_STEP_SUMMARY - echo "- ๐ŸŽญ Staging: https://game-2048-staging.game-2048-staging.staging.wa.darknex.us" >> $GITHUB_STEP_SUMMARY - echo "- ๐Ÿš€ Production: https://game-2048-prod.game-2048-prod.wa.darknex.us" >> $GITHUB_STEP_SUMMARY + + # Use canonical domain format + DEV_URL="https://game-2048-dev.game-2048-dev.dev.wa.darknex.us" + STAGING_URL="https://game-2048-staging.game-2048-staging.staging.wa.darknex.us" + PROD_URL="https://game-2048-prod.game-2048-prod.wa.darknex.us" + + echo "- ๐Ÿงช Development: $DEV_URL" >> $GITHUB_STEP_SUMMARY + echo "- ๐ŸŽญ Staging: $STAGING_URL" >> $GITHUB_STEP_SUMMARY + echo "- ๐Ÿš€ Production: $PROD_URL" >> $GITHUB_STEP_SUMMARY diff --git a/src/index.html b/src/index.html index ef2bdda..d090505 100644 --- a/src/index.html +++ b/src/index.html @@ -3,7 +3,7 @@ - Knative 2048 v2.0.1 - Auto-Deploy Pipeline โœจ + Knative 2048 v2.0.2 - Canonical Domain Testing ๐Ÿš€