43 lines
1.3 KiB
Bash
Executable File
43 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
# Harbor Stack Initialization Script
|
|
# This script sets up both registry-cache and Harbor on Mac Studio
|
|
|
|
echo "=== Harbor Stack Initialization ==="
|
|
|
|
# Configuration
|
|
HARBOR_STACK_DIR="$(pwd)/harbor-stack"
|
|
REGISTRY_CACHE_DIR="$HARBOR_STACK_DIR/registry-cache"
|
|
HARBOR_DIR="$HARBOR_STACK_DIR/harbor"
|
|
HARBOR_VERSION="v2.11.1" # Using latest stable version
|
|
HARBOR_INSTALLER="harbor-offline-installer-$HARBOR_VERSION.tgz"
|
|
|
|
# Create necessary directories
|
|
echo "Creating directories..."
|
|
mkdir -p "$REGISTRY_CACHE_DIR"
|
|
mkdir -p "$HARBOR_DIR"
|
|
|
|
# Download Harbor if not already downloaded
|
|
if [ ! -f "$HARBOR_DIR/$HARBOR_INSTALLER" ]; then
|
|
echo "Downloading Harbor $HARBOR_VERSION..."
|
|
curl -L -o "$HARBOR_DIR/$HARBOR_INSTALLER" "https://github.com/goharbor/harbor/releases/download/$HARBOR_VERSION/harbor-offline-installer-$HARBOR_VERSION.tgz"
|
|
else
|
|
echo "Harbor installer already exists, skipping download."
|
|
fi
|
|
|
|
# Extract Harbor
|
|
if [ ! -d "$HARBOR_DIR/harbor" ]; then
|
|
echo "Extracting Harbor..."
|
|
cd "$HARBOR_DIR"
|
|
tar -xzf "$HARBOR_INSTALLER"
|
|
else
|
|
echo "Harbor already extracted, skipping extraction."
|
|
fi
|
|
|
|
echo "Harbor setup completed in $HARBOR_DIR"
|
|
echo "Next steps:"
|
|
echo "1. Generate SSL certificates for Harbor"
|
|
echo "2. Configure harbor.yml"
|
|
echo "3. Run Harbor installation" |