Initial commit: add .gitignore and README
This commit is contained in:
59
infrastructure/setup-shared-infrastructure.sh
Executable file
59
infrastructure/setup-shared-infrastructure.sh
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Load shared libraries
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
|
||||
# Script to set up shared infrastructure services
|
||||
|
||||
set -e
|
||||
|
||||
echo "🏗️ Setting up shared infrastructure services..."
|
||||
|
||||
# Check prerequisites
|
||||
command -v kubectl >/dev/null 2>&1 || { echo "❌ kubectl not found"; exit 1; }
|
||||
command -v helm >/dev/null 2>&1 || { echo "❌ helm not found"; exit 1; }
|
||||
|
||||
# Configuration
|
||||
NAMESPACE="shared-services"
|
||||
REGISTRY_NAMESPACE="container-registry"
|
||||
|
||||
echo "📋 Creating namespaces..."
|
||||
kubectl create namespace "$NAMESPACE" --dry-run=client -o yaml | kubectl apply -f -
|
||||
kubectl create namespace "$REGISTRY_NAMESPACE" --dry-run=client -o yaml | kubectl apply -f -
|
||||
|
||||
echo "📦 Setting up Prometheus/Grafana..."
|
||||
# Add Prometheus Helm repo
|
||||
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
|
||||
helm repo update
|
||||
|
||||
# Install Prometheus Stack
|
||||
helm upgrade --install prometheus prometheus-community/kube-prometheus-stack \
|
||||
--namespace "$NAMESPACE" \
|
||||
--create-namespace \
|
||||
--set prometheus.prometheusSpec.retention=30d \
|
||||
--wait || echo "⚠️ Prometheus installation skipped (may already exist)"
|
||||
|
||||
echo "📊 Setting up Loki for logging..."
|
||||
helm repo add grafana https://grafana.github.io/helm-charts
|
||||
helm repo update
|
||||
|
||||
helm upgrade --install loki grafana/loki-stack \
|
||||
--namespace "$NAMESPACE" \
|
||||
--create-namespace \
|
||||
--wait || echo "⚠️ Loki installation skipped (may already exist)"
|
||||
|
||||
echo "🐳 Setting up container registry (Harbor)..."
|
||||
# Harbor setup would go here
|
||||
echo " → Harbor setup requires additional configuration"
|
||||
echo " → See: https://goharbor.io/docs/"
|
||||
|
||||
echo "✅ Shared infrastructure setup initiated!"
|
||||
echo ""
|
||||
echo "📝 Next steps:"
|
||||
echo " 1. Configure Prometheus/Grafana dashboards"
|
||||
echo " 2. Set up Loki log aggregation"
|
||||
echo " 3. Deploy container registry"
|
||||
echo " 4. Configure monitoring alerts"
|
||||
echo " 5. Migrate projects to shared infrastructure"
|
||||
|
||||
45
infrastructure/setup.sh
Executable file
45
infrastructure/setup.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
# Workspace Setup Script
|
||||
# Initializes the workspace with required tools and dependencies
|
||||
|
||||
set -e
|
||||
|
||||
# Load shared libraries
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
|
||||
log_heading "🚀 Setting up workspace..."
|
||||
|
||||
log_step "Checking required tools..."
|
||||
require_command node
|
||||
require_command npm
|
||||
require_command git
|
||||
|
||||
# Check for pnpm
|
||||
if check_command pnpm; then
|
||||
log_success "pnpm is installed"
|
||||
else
|
||||
log_info "Installing pnpm..."
|
||||
npm install -g pnpm
|
||||
log_success "pnpm installed"
|
||||
fi
|
||||
|
||||
# Install workspace dependencies if package.json exists
|
||||
PROJECT_ROOT="$(get_project_root)"
|
||||
if [ -f "$PROJECT_ROOT/package.json" ]; then
|
||||
log_step "Installing workspace dependencies..."
|
||||
cd "$PROJECT_ROOT"
|
||||
pnpm install
|
||||
log_success "Workspace dependencies installed"
|
||||
fi
|
||||
|
||||
# Install root-level dependencies
|
||||
if [ -f "$PROJECT_ROOT/pnpm-workspace.yaml" ]; then
|
||||
log_step "Installing monorepo dependencies..."
|
||||
cd "$PROJECT_ROOT"
|
||||
pnpm install
|
||||
log_success "Monorepo dependencies installed"
|
||||
fi
|
||||
|
||||
log_success "Workspace setup complete!"
|
||||
|
||||
Reference in New Issue
Block a user