Files
blackroad/bin/blackroad-deploy
Alexa Amundson 78fbe80f2a Initial monorepo — everything BlackRoad in one place
bin/       230 CLI tools (ask-*, br-*, agent-*, roadid, carpool)
scripts/   99 automation scripts
fleet/     Node configs and deployment
workers/   Cloudflare Worker sources (roadpay, road-search, squad webhooks)
roadc/     RoadC programming language
roadnet/   Mesh network (5 APs, WireGuard)
operator/  Memory system scripts
config/    System configs
dotfiles/  Shell configs
docs/      Documentation

BlackRoad OS — Pave Tomorrow.

RoadChain-SHA2048: d1a24f55318d338b
RoadChain-Identity: alexa@sovereign
RoadChain-Full: d1a24f55318d338b24b60bad7be39286379c76ae5470817482100cb0ddbbcb97e147d07ac7243da0a9f0363e4e5c833d612b9c0df3a3cd20802465420278ef74875a5b77f55af6fe42a931b8b635b3d0d0b6bde9abf33dc42eea52bc03c951406d8cbe49f1a3d29b26a94dade05e9477f34a7d4d4c6ec4005c3c2ac54e73a68440c512c8e83fd9b1fe234750b898ef8f4032c23db173961fe225e67a0432b5293a9714f76c5c57ed5fdf35b9fb40fd73c03ebf88b7253c6a0575f5afb6a6b49b3bda310602fb1ef676859962dad2aebbb2875814b30eee0a8ba195e482d4cbc91d8819e7f38f6db53e8063401649c77bb994371473cabfb917fb53e8cbe73d60
2026-03-14 17:08:41 -05:00

216 lines
7.4 KiB
Bash

#!/usr/bin/env bash
# ============================================================================
# BLACKROAD OS, INC. - PROPRIETARY AND CONFIDENTIAL
# Copyright (c) 2025-2026 BlackRoad OS, Inc. All Rights Reserved.
#
# This code is the intellectual property of BlackRoad OS, Inc.
# AI-assisted development does not transfer ownership to AI providers.
# Unauthorized use, copying, or distribution is prohibited.
# NOT licensed for AI training or data extraction.
# ============================================================================
# BlackRoad Deploy - Brand-Enforcing Wrangler Wrapper
# Ensures all deployments meet brand standards before going live
set -euo pipefail
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
MAGENTA='\033[0;35m'
PINK='\033[38;5;205m'
NC='\033[0m'
AUDIT_SCRIPT="$HOME/bin/audit-brand-compliance.sh"
MIN_COMPLIANCE=90
echo -e "${MAGENTA}🌌 BlackRoad Deploy - Brand-Enforced Deployment${NC}"
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo ""
# Check if file/directory provided
if [ $# -eq 0 ]; then
echo -e "${RED}❌ Error: No deployment target specified${NC}"
echo ""
echo "Usage:"
echo " blackroad-deploy <file-or-directory> [--project-name=NAME] [--force]"
echo ""
echo "Examples:"
echo " blackroad-deploy ./dist --project-name=my-project"
echo " blackroad-deploy ./index.html --project-name=my-site"
echo " blackroad-deploy ./dist --project-name=my-project --force # Skip compliance check"
exit 1
fi
DEPLOY_TARGET="$1"
shift
# Parse additional arguments
FORCE_DEPLOY=false
PROJECT_NAME=""
WRANGLER_ARGS=()
while [[ $# -gt 0 ]]; do
case $1 in
--force)
FORCE_DEPLOY=true
shift
;;
--project-name=*)
PROJECT_NAME="${1#*=}"
WRANGLER_ARGS+=("$1")
shift
;;
*)
WRANGLER_ARGS+=("$1")
shift
;;
esac
done
# Validate deployment target exists
if [ ! -e "$DEPLOY_TARGET" ]; then
echo -e "${RED}❌ Error: Deployment target not found: $DEPLOY_TARGET${NC}"
exit 1
fi
echo -e "${PINK}📦 Deployment target: ${YELLOW}$DEPLOY_TARGET${NC}"
if [ -n "$PROJECT_NAME" ]; then
echo -e "${PINK}📋 Project name: ${YELLOW}$PROJECT_NAME${NC}"
fi
echo ""
# Run brand compliance check (unless --force)
if [ "$FORCE_DEPLOY" = false ]; then
echo -e "${MAGENTA}🔍 Running brand compliance check...${NC}"
echo ""
# Find HTML files in deployment target
HTML_FILES=()
if [ -f "$DEPLOY_TARGET" ]; then
if [[ "$DEPLOY_TARGET" == *.html ]]; then
HTML_FILES=("$DEPLOY_TARGET")
fi
elif [ -d "$DEPLOY_TARGET" ]; then
while IFS= read -r -d '' file; do
HTML_FILES+=("$file")
done < <(find "$DEPLOY_TARGET" -name "*.html" -type f -print0)
fi
if [ ${#HTML_FILES[@]} -eq 0 ]; then
echo -e "${YELLOW}⚠️ Warning: No HTML files found to check${NC}"
echo -e "${YELLOW} Proceeding with deployment (non-HTML project)${NC}"
echo ""
else
# Check compliance for each HTML file
TOTAL_SCORE=0
FILE_COUNT=0
for html_file in "${HTML_FILES[@]}"; do
echo -e "${PINK} Checking: ${html_file}${NC}"
# Run basic checks
SCORE=100
ISSUES=()
if ! grep -q "#FF1D6C" "$html_file"; then
ISSUES+=("Missing hot-pink color")
SCORE=$((SCORE - 10))
fi
if ! grep -q "gradient-brand" "$html_file"; then
ISSUES+=("Missing brand gradient")
SCORE=$((SCORE - 15))
fi
if ! grep -q "road-dashes" "$html_file"; then
ISSUES+=("Missing BlackRoad logo")
SCORE=$((SCORE - 15))
fi
if ! grep -q "scroll-progress" "$html_file"; then
ISSUES+=("Missing scroll progress bar")
SCORE=$((SCORE - 10))
fi
if ! grep -q "line-height: 1.618" "$html_file"; then
ISSUES+=("Missing Golden Ratio typography")
SCORE=$((SCORE - 10))
fi
if [ $SCORE -lt 100 ]; then
echo -e " ${YELLOW}⚠️ Compliance: ${SCORE}%${NC}"
for issue in "${ISSUES[@]}"; do
echo -e " ${RED}${NC} $issue"
done
else
echo -e " ${GREEN}✅ Compliance: 100%${NC}"
fi
TOTAL_SCORE=$((TOTAL_SCORE + SCORE))
FILE_COUNT=$((FILE_COUNT + 1))
done
# Calculate average
AVG_SCORE=$((TOTAL_SCORE / FILE_COUNT))
echo ""
echo -e "${MAGENTA}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e " Average compliance: ${BLUE}${AVG_SCORE}%${NC}"
echo -e " Minimum required: ${YELLOW}${MIN_COMPLIANCE}%${NC}"
echo -e "${MAGENTA}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo ""
# Check if meets minimum
if [ $AVG_SCORE -lt $MIN_COMPLIANCE ]; then
echo -e "${RED}❌ COMPLIANCE FAILURE${NC}"
echo -e "${RED} Project does not meet minimum brand standards (${MIN_COMPLIANCE}%)${NC}"
echo ""
echo -e "Options:"
echo -e " 1. Fix brand compliance issues"
echo -e " 2. Use starter template: ${PINK}cp ~/blackroad-template-starter.html ./${NC}"
echo -e " 3. Force deploy (not recommended): ${YELLOW}blackroad-deploy $DEPLOY_TARGET --force${NC}"
echo ""
exit 1
fi
echo -e "${GREEN}✅ Brand compliance check passed!${NC}"
echo ""
fi
else
echo -e "${YELLOW}⚠️ --force flag used, skipping compliance check${NC}"
echo ""
fi
# Deploy with wrangler
echo -e "${MAGENTA}🚀 Deploying to Cloudflare Pages...${NC}"
echo ""
DEPLOY_CMD="wrangler pages deploy \"$DEPLOY_TARGET\""
for arg in "${WRANGLER_ARGS[@]}"; do
DEPLOY_CMD="$DEPLOY_CMD \"$arg\""
done
echo -e "${PINK}Command: ${DEPLOY_CMD}${NC}"
echo ""
if eval "$DEPLOY_CMD"; then
echo ""
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${GREEN}✅ DEPLOYMENT SUCCESSFUL!${NC}"
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo ""
if [ -n "$PROJECT_NAME" ]; then
echo -e " View deployment: ${PINK}https://$PROJECT_NAME.pages.dev${NC}"
fi
echo ""
else
echo ""
echo -e "${RED}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${RED}❌ DEPLOYMENT FAILED${NC}"
echo -e "${RED}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
exit 1
fi