Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions deploy-demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/bash

# Echo Ads Demo Deployment Script
# Deploys the Echo Ads demo to Google Cloud Storage

set -e

PROJECT_ID="jono-sandbox"
BUCKET_NAME="echoads-demo"
DEMO_FILE="integrationExamples/gpt/echoAds_gumgum.html"
PREBID_BUNDLE="build/dev/prebid.js"

echo "🚀 Deploying Echo Ads Demo to Google Cloud Storage..."

# Check if gcloud is installed
if ! command -v gcloud &> /dev/null; then
echo "❌ Error: gcloud CLI is not installed"
echo "Install from: https://cloud.google.com/sdk/docs/install"
exit 1
fi

# Check if gsutil is installed
if ! command -v gsutil &> /dev/null; then
echo "❌ Error: gsutil is not installed"
echo "Install gcloud SDK to get gsutil"
exit 1
fi

# Set the correct GCloud project
echo "📋 Setting GCloud project to $PROJECT_ID..."
gcloud config set project $PROJECT_ID

# Check if files exist
if [ ! -f "$DEMO_FILE" ]; then
echo "❌ Error: Demo file not found at $DEMO_FILE"
exit 1
fi

if [ ! -f "$PREBID_BUNDLE" ]; then
echo "⚠️ Prebid bundle not found, building now..."
npx gulp build-bundle-dev --modules=echoAdsModule,gumgumBidAdapter --nolint

if [ ! -f "$PREBID_BUNDLE" ]; then
echo "❌ Error: Build failed, bundle still not found"
exit 1
fi
fi

# Create temporary HTML with corrected paths for deployment
echo "📝 Preparing deployment HTML..."
TEMP_HTML=$(mktemp)
sed 's|../../build/dev/prebid.js|https://storage.googleapis.com/'"$BUCKET_NAME"'/build/dev/prebid.js|g' "$DEMO_FILE" > "$TEMP_HTML"

# Upload files with public read permissions
echo "📤 Uploading demo HTML..."
gsutil -h "Content-Type:text/html" cp "$TEMP_HTML" gs://$BUCKET_NAME/index.html
gsutil acl ch -u AllUsers:R gs://$BUCKET_NAME/index.html

echo "📤 Uploading Prebid.js bundle..."
gsutil -h "Content-Type:application/javascript" cp "$PREBID_BUNDLE" gs://$BUCKET_NAME/build/dev/prebid.js
gsutil acl ch -u AllUsers:R gs://$BUCKET_NAME/build/dev/prebid.js

# Clean up temp file
rm "$TEMP_HTML"

# Set cache control headers for demo (no-store ensures always fresh content)
echo "⚙️ Setting cache headers..."
gsutil setmeta -h "Cache-Control:no-store, no-cache, must-revalidate" gs://$BUCKET_NAME/index.html
gsutil setmeta -h "Cache-Control:no-store, no-cache, must-revalidate" gs://$BUCKET_NAME/build/dev/prebid.js
gsutil setmeta -h "Cache-Control:no-store, no-cache, must-revalidate" gs://$BUCKET_NAME/creatives/acme.png 2>/dev/null || true

echo "✅ Deployment complete!"
echo ""
echo "🌐 Demo URL: https://storage.googleapis.com/$BUCKET_NAME/index.html"
echo ""
echo "💡 Tips:"
echo " - Clear browser cache if you don't see updates"
echo " - Use incognito/private mode for fresh testing"
echo " - Check browser console for Echo Ads logs"
38 changes: 38 additions & 0 deletions deploy-github-pages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# GitHub Pages Deployment Script
# Deploys the Echo Ads demo to GitHub Pages

set -e

PREBID_BUNDLE="build/dev/prebid.js"
DOCS_DIR="docs"

echo "🚀 Deploying Echo Ads Demo to GitHub Pages..."

# Check if prebid bundle exists
if [ ! -f "$PREBID_BUNDLE" ]; then
echo "⚠️ Prebid bundle not found, building now..."
npx gulp build-bundle-dev --modules=echoAdsModule,gumgumBidAdapter --nolint

if [ ! -f "$PREBID_BUNDLE" ]; then
echo "❌ Error: Build failed, bundle still not found"
exit 1
fi
fi

# Copy prebid.js to docs folder
echo "📤 Copying prebid.js to docs folder..."
cp "$PREBID_BUNDLE" "$DOCS_DIR/prebid.js"

# Commit and push
echo "📝 Committing changes..."
git add "$DOCS_DIR/prebid.js" "$DOCS_DIR/index.html" "$DOCS_DIR/creatives/"
git commit -m "Update GitHub Pages demo" || echo "No changes to commit"
git push origin master

echo "✅ Deployment complete!"
echo ""
echo "🌐 Demo URL: https://gumgum.github.io/echoads/"
echo ""
echo "💡 Note: GitHub Pages may take 1-2 minutes to update"
Binary file added echoAdsDemo/creatives/acme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added echoAdsDemo/creatives/mrec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading