Add monthly-bvn-build.sh implementing environment variables

This commit is contained in:
2025-10-12 12:18:46 -05:00
parent b0dd929427
commit 19c5817b65
3 changed files with 223 additions and 25 deletions

View File

@@ -0,0 +1,62 @@
2025-10-12 11:33:39 - === BUILD START -- Log: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log ===
2025-10-12 11:33:39 - .env.monthly-bvn-build loaded successfully: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log
2025-10-12 11:33:40 - Environment: GIT_BRANCH=bvn-modularized, LOCAL_BVN_REPO_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev, SITE_DIR_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev/_site
2025-10-12 11:33:40 - Starting git pull from bvn-modularized
2025-10-12 11:39:33 - === BUILD START -- Log: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log ===
2025-10-12 11:39:33 - .env.monthly-bvn-build loaded successfully: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log
2025-10-12 11:39:34 - Environment: GIT_BRANCH=bvn-modularized, LOCAL_BVN_REPO_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev, SITE_DIR_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev/_site
2025-10-12 11:39:34 - Starting git pull from bvn-modularized
2025-10-12 11:39:58 - git pull: SUCCESS
2025-10-12 11:39:58 - Starting rm -rf /c/Repos/bloomvalleydemo.dlseitz.dev/_site
2025-10-12 11:39:58 - rm -rf /c/Repos/bloomvalleydemo.dlseitz.dev/_site: SUCCESS
2025-10-12 11:39:58 - Starting npx @11ty/eleventy
2025-10-12 11:40:04 - npx @11ty/eleventy: SUCCESS - Rebuild complete
2025-10-12 11:40:04 - Script completed successfully
2025-10-12 11:40:04 - === BUILD END: 2025-10-12 11:40:04 ===
2025-10-12 11:40:04 - --------------------------------
2025-10-12 11:48:27 - === BUILD START -- Log: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log ===
2025-10-12 11:48:27 - .env.monthly-bvn-build loaded successfully: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log
2025-10-12 11:48:27 - Environment: GIT_BRANCH=bvn-modularized, LOCAL_BVN_REPO_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev, SITE_DIR_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev/_site
2025-10-12 11:48:27 - SSH agent started: SUCCESS
2025-10-12 11:48:27 - Adding SSH key to agent
2025-10-12 11:48:34 - SSH key add: FAILURE (code 1, check key/passphrase/path)
2025-10-12 11:51:41 - === BUILD START -- Log: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log ===
2025-10-12 11:51:41 - .env.monthly-bvn-build loaded successfully: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log
2025-10-12 11:51:41 - Environment: GIT_BRANCH=bvn-modularized, LOCAL_BVN_REPO_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev, SITE_DIR_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev/_site
2025-10-12 11:51:41 - SSH agent started: SUCCESS
2025-10-12 11:51:41 - Adding SSH key to agent
2025-10-12 11:51:42 - SSH key add: FAILURE (code 1, check key/passphrase/path)
2025-10-12 11:57:18 - === BUILD START -- Log: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log ===
2025-10-12 11:57:18 - .env.monthly-bvn-build loaded successfully: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log
2025-10-12 11:57:18 - Environment: GIT_BRANCH=bvn-modularized, LOCAL_BVN_REPO_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev, SITE_DIR_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev/_site
2025-10-12 11:57:18 - SSH agent started: SUCCESS
2025-10-12 11:57:18 - Adding SSH key to agent
2025-10-12 11:57:18 - SSH key add: FAILURE (code 1, check key/passphrase/path)
2025-10-12 12:06:52 - === BUILD START -- Log: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log ===
2025-10-12 12:06:52 - .env.monthly-bvn-build loaded successfully: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log
2025-10-12 12:06:53 - Environment: GIT_BRANCH=bvn-modularized, LOCAL_BVN_REPO_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev, SITE_DIR_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev/_site
2025-10-12 12:06:53 - Starting git pull from bvn-modularized (HTTPS public repo)
2025-10-12 12:11:22 - === BUILD START -- Log: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log ===
2025-10-12 12:11:22 - .env.monthly-bvn-build loaded successfully: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log
2025-10-12 12:11:22 - Environment: GIT_BRANCH=bvn-modularized, LOCAL_BVN_REPO_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev, SITE_DIR_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev/_site
2025-10-12 12:11:22 - Starting git pull from bvn-modularized (HTTPS public repo)
2025-10-12 12:11:23 - git pull: SUCCESS
2025-10-12 12:11:23 - Starting rm -rf /c/Repos/bloomvalleydemo.dlseitz.dev/_site
2025-10-12 12:11:23 - rm -rf /c/Repos/bloomvalleydemo.dlseitz.dev/_site: SUCCESS
2025-10-12 12:11:23 - Starting npx @11ty/eleventy
2025-10-12 12:11:28 - npx @11ty/eleventy: SUCCESS - Rebuild complete
2025-10-12 12:11:28 - Script completed successfully
2025-10-12 12:11:28 - === BUILD END: 2025-10-12 12:11:28 ===
--------------------------------
2025-10-12 12:11:47 - === BUILD START -- Log: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log ===
2025-10-12 12:11:47 - .env.monthly-bvn-build loaded successfully: /c/Repos/bloomvalleydemo.dlseitz.dev/logs/monthly-bvn-build.log
2025-10-12 12:11:47 - Environment: GIT_BRANCH=bvn-modularized, LOCAL_BVN_REPO_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev, SITE_DIR_PATH=/c/Repos/bloomvalleydemo.dlseitz.dev/_site
2025-10-12 12:11:47 - Starting git pull from bvn-modularized (HTTPS public repo)
2025-10-12 12:11:48 - git pull: SUCCESS
2025-10-12 12:11:48 - Starting rm -rf /c/Repos/bloomvalleydemo.dlseitz.dev/_site
2025-10-12 12:11:48 - rm -rf /c/Repos/bloomvalleydemo.dlseitz.dev/_site: SUCCESS
2025-10-12 12:11:48 - Starting npx @11ty/eleventy
2025-10-12 12:11:52 - npx @11ty/eleventy: SUCCESS - Rebuild complete
2025-10-12 12:11:52 - Script completed successfully
2025-10-12 12:11:53 - === BUILD END: 2025-10-12 12:11:52 ===
--------------------------------

123
monthly-bvn-build.sh Normal file
View File

@@ -0,0 +1,123 @@
#!/bin/bash
# -----
# Add "# " to lines ": << 'EOF'" and "EOF" (simplified script)
# == AND ==
# remove "# " from lines "# : << 'EOF'" and "# EOF" (advanced script)
# to toggle Logging Feature. Reverse to toggle back.
# -----
: << 'EOF'
# Simplified script without logging feature
# Dynamically ensure correct pwd
cd "$(dirname "${BASH_SOURCE[0]}")"
# Load environment variables from .env.monthly-bvn-build
source .env.monthly-bvn-build 2>/dev/null
export LOCAL_BVN_REPO_PATH GIT_BRANCH SITE_DIR_PATH LOG_PATH
# Ensure log dir exists (silent)
mkdir -p "$(dirname "$LOG_PATH")"
# Update repo via HTTPS (public repo, no auth needed)
git pull origin "$GIT_BRANCH" || true
# Remove 11ty build artifacts
rm -rf "${SITE_DIR_PATH}"
# Rebuild static site
npx @11ty/eleventy
EOF
# ----------
# : << 'EOF'
# Advanced script with logging feature added
#!/bin/bash
# Disable auto-exit for custom handling (add set -e if desired)
set +e
# Dynamically ensure correct pwd (no logging yet, as LOG_PATH undefined)
cd "$(dirname "${BASH_SOURCE[0]}")"
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "$(date '+%Y-%m-%d %H:%M:%S') - ERROR: cd to script directory failed with code $exit_code" >&2
exit $exit_code
fi
echo "$(date '+%Y-%m-%d %H:%M:%S') - cd to script directory: SUCCESS" >&2
# Load environment variables from .env.monthly-bvn-build (log to stderr for this step)
echo "$(date '+%Y-%m-%d %H:%M:%S') - Starting source .env.monthly-bvn-build" >&2
source .env.monthly-bvn-build 2>/dev/null
export LOCAL_BVN_REPO_PATH GIT_BRANCH SITE_DIR_PATH LOG_PATH
exit_code=$?
if [ $exit_code -eq 0 ] && [ -n "$LOCAL_BVN_REPO_PATH" ] && [ -n "$GIT_BRANCH" ] && [ -n "$SITE_DIR_PATH" ] && [ -n "$LOG_PATH" ]; then
echo "$(date '+%Y-%m-%d %H:%M:%S') - Source .env.monthly-bvn-build: SUCCESS (base: $LOCAL_BVN_REPO_PATH, log: $LOG_PATH)" >&2
else
echo "$(date '+%Y-%m-%d %H:%M:%S') - Source .env.monthly-bvn-build: FAILURE (code $exit_code or missing vars) - Aborting" >&2
exit $exit_code
fi
# Ensure log dir exists (silent)
mkdir -p "$(dirname "$LOG_PATH")"
# Now define log function, as LOG_PATH is set
echo "$(date '+%Y-%m-%d %H:%M:%S') - === BUILD START -- Log: $LOG_PATH ===" >> "$LOG_PATH"
log_step() {
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> "$LOG_PATH"
}
log_exit() {
echo "--------------------------------" >> "$LOG_PATH"
}
# Log the successful setup to the file
log_step ".env.monthly-bvn-build loaded successfully: $LOG_PATH"
# Log environment details
log_step "Environment: GIT_BRANCH=$GIT_BRANCH, LOCAL_BVN_REPO_PATH=$LOCAL_BVN_REPO_PATH, SITE_DIR_PATH=$SITE_DIR_PATH"
# Update repo from correct branch (non-fatal, HTTPS public)
log_step "Starting git pull from $GIT_BRANCH (HTTPS public repo)"
git pull "$GIT_REPO" "$GIT_BRANCH" || true
exit_code=$?
if [ $exit_code -eq 0 ]; then
log_step "git pull: SUCCESS"
else
log_step "git pull: FAILURE (code $exit_code, but continuing)"
fi
# Remove 11ty build artifacts
log_step "Starting rm -rf ${SITE_DIR_PATH}"
rm -rf "${SITE_DIR_PATH}"
exit_code=$?
if [ $exit_code -eq 0 ]; then
log_step "rm -rf ${SITE_DIR_PATH}: SUCCESS"
else
log_step "rm -rf ${SITE_DIR_PATH}: FAILURE (code $exit_code)"
log_exit
exit $exit_code
fi
# Rebuild static site
log_step "Starting npx @11ty/eleventy"
npx @11ty/eleventy
exit_code=$?
if [ $exit_code -eq 0 ]; then
log_step "npx @11ty/eleventy: SUCCESS - Rebuild complete"
else
log_step "npx @11ty/eleventy: FAILURE (code $exit_code)"
log_exit
exit $exit_code
fi
# Overall script completion
log_step "Script completed successfully"
log_step "=== BUILD END: $(date '+%Y-%m-%d %H:%M:%S') ==="
log_exit
exit 0
# EOF

View File

@@ -3,52 +3,65 @@ module.exports = { normalizedEvents: [
"calid": "3521964000000010003", "calid": "3521964000000010003",
"title": "Gardening 101 with Bethany Bloom", "title": "Gardening 101 with Bethany Bloom",
"uid": "6788b6fe00ef48d18749a55366207c76@zoho.com", "uid": "6788b6fe00ef48d18749a55366207c76@zoho.com",
"start": "20250909T183000-0500", "start": "20251014T183000-0500",
"end": "20250909T203000-0500", "end": "20251014T203000-0500",
"isallday": false, "isallday": false,
"location": "Bloom Valley Nursery", "location": "Bloom Valley Nursery",
"displayDate": "Tuesday, September 9, 2025 • 6:30 PM 8:30 PM", "displayDate": "Tuesday, October 14, 2025 • 6:30 PM 8:30 PM",
"color": "#FC6060", "color": "#FC6060",
"description": "Join Bethany Bloom as she shares her tips for creating a themed decor through-out the home that you will be delighted to share with your guests!\n\n\n\n**This is a demo event for demonstration purposes only.**\n\n", "description": "Join Bethany Bloom as she shares her tips for creating a themed decor through-out the home that you will be delighted to share with your guests!\n\n",
"category": "workshop" "category": "workshop"
}, },
{ {
"calid": "3521964000000010003", "calid": "3521964000000010003",
"title": "Labor Day Sale", "title": "Halloween Spooktacular - Bloom Valley Community Center",
"uid": "1ae512d837304fcc91c8920aa90a1f44@zoho.com", "uid": "8adadebd374c46e09f1e9d7eece45888@zoho.com",
"start": "20250901", "start": "20251025T170000-0500",
"end": "20250902", "end": "20251025T220000-0500",
"isallday": true, "isallday": false,
"location": "Bloom Valley Nursery", "location": "Bloom Valley Community center",
"displayDate": "Monday, September 1, 2025", "displayDate": "Saturday, October 25, 2025 • 5:00 PM 10:00 PM",
"color": "#7CAA56", "color": "#FFC464",
"description": "Celebrate Labor Day with Bloom Valley Nursery! Enjoy special discounts on select plants, gardening tools, and seasonal decor. This one-day event is a perfect opportunity to stock up on everything you need to make your home and garden thrive. \n\n**This is a demo event for demonstration purposes only—no actual sales will take place.**\n\n", "description": "Join the Bloom Valley Chamber of Commerce at the Bloom Valley Community Center for this year's Halloween Spooktacular, a thrilling event packed with activities for all ages. Test your creativity in our costume contest, carve the most impressive pumpkin in our pumpkin carving contest, and brave the chills in our haunted house tour. Get ready to dance the night away at the \"Monster Mash\" dance party, where the official Bloom Valley DJ will spin all kinds of spooky tunes starting at 7:00 pm. Little ones will love the face painting and other kid-friendly activities. Don't miss out on this frightfully fun evening!\n\n",
"category": "sales" "category": "community"
}, },
{ {
"calid": "3521964000000010003", "calid": "3521964000000010003",
"title": "Landscaping 101 with Vincent Bloom", "title": "Landscaping 101 with Vincent Bloom",
"uid": "60085fc27f5045a5bf462c38c02677b0@zoho.com", "uid": "60085fc27f5045a5bf462c38c02677b0@zoho.com",
"start": "20250916T183000-0500", "start": "20251021T183000-0500",
"end": "20250916T203000-0500", "end": "20251021T203000-0500",
"isallday": false, "isallday": false,
"location": "Bloom Valley Nursery", "location": "Bloom Valley Nursery",
"displayDate": "Tuesday, September 16, 2025 • 6:30 PM 8:30 PM", "displayDate": "Tuesday, October 21, 2025 • 6:30 PM 8:30 PM",
"color": "#FC6060", "color": "#FC6060",
"description": "Come learn from Vincent Bloom, one of Bloom Valley Nursery's family owners, as he guides you through the art and science of landscaping. This workshop is designed for community members who want to create beautiful, sustainable outdoor spaces. We'll explore local plant varieties, discuss eco-friendly landscaping methods, and share tips for a garden that not only looks great but also supports our local ecosystem.\n\n", "description": "Come learn from Vincent Bloom, one of Bloom Valley Nursery's family owners, as he guides you through the art and science of landscaping. This workshop is designed for community members who want to create beautiful, sustainable outdoor spaces. We'll explore local plant varieties, discuss eco-friendly landscaping methods, and share tips for a garden that not only looks great but also supports our local ecosystem.\n\n",
"category": "workshop" "category": "workshop"
}, },
{ {
"calid": "3521964000000010003", "calid": "3521964000000010003",
"title": "Johnny Appleseed Day", "title": "Fall Plan Sale",
"uid": "e0394985af2845fd8c1de4b782c139fb@zoho.com", "uid": "3ac0f6eef443419d9107b86b62ac026f@zoho.com",
"start": "20250926T173000-0500", "start": "20251004",
"end": "20250926T193000-0500", "end": "20251005",
"isallday": true,
"location": "Bloom Valley Nursery",
"displayDate": "Saturday, October 4, 2025",
"color": "#7CAA56",
"description": "Kick off the fall season with a massive plant sale. Offer a variety of fall plants, bulbs, and shrubs. Provide discounts on select items and bundle deals. Include a \"Mystery Plant\" section where customers can buy a plant at a discounted price without knowing what it is until they take it home.\n\n",
"category": "sales"
},
{
"calid": "3521964000000010003",
"title": "Pumpkin Decorating Workshop",
"uid": "c0144577e37945da80f3131d151f7eba@zoho.com",
"start": "20251031T163000-0500",
"end": "20251031T183000-0500",
"isallday": false, "isallday": false,
"location": "Bloom Valley Nursery", "location": "Bloom Valley Nursery",
"displayDate": "Friday, September 26, 2025 • 5:30 PM 7:30 PM", "displayDate": "Friday, October 31, 2025 • 4:30 PM 6:30 PM",
"color": "#FFC464", "color": "#FC6060",
"description": "Celebrate the legacy of Johnny Appleseed with us! Join our hands-on workshop where you'll get to pick fresh, crisp apples right from our orchard and then learn how to properly plant your very own apple tree sapling. Our expert growers will share tips on nurturing your tree so it can thrive for years to come. This is a wonderful, educational event for the whole family to connect with nature and grow something beautiful.\n\n", "description": "Get ready for Halloween by choosing the perfect pumpkin from our patch! We'll provide all the supplies—paints, glitter, googly eyes, and more—so you can unleash your creativity. This is a family-friendly event where you can transform your pumpkin into a spooky, silly, or sparkling masterpiece to take home.\n\n",
"category": "community" "category": "workshop"
} }
] }; ] };