blumeops/argocd/manifests/devpi/start.sh
Erich Blume 8e9ab46335 Add devpi auto-initialization with startup script
- Startup script checks for initialization and runs devpi-init if needed
- Root password passed via DEVPI_ROOT_PASSWORD env var from secret
- Secret template references 1Password vault item
- Updated README with setup instructions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 11:19:37 -08:00

30 lines
760 B
Bash

#!/bin/bash
set -e
SERVERDIR="${DEVPI_SERVERDIR:-/devpi}"
HOST="${DEVPI_HOST:-0.0.0.0}"
PORT="${DEVPI_PORT:-3141}"
OUTSIDE_URL="${DEVPI_OUTSIDE_URL:-}"
# Check if devpi is initialized
if [ ! -f "$SERVERDIR/.serverversion" ]; then
echo "Initializing devpi server..."
if [ -z "$DEVPI_ROOT_PASSWORD" ]; then
echo "ERROR: DEVPI_ROOT_PASSWORD environment variable must be set for initialization"
exit 1
fi
devpi-init --serverdir "$SERVERDIR" --root-passwd "$DEVPI_ROOT_PASSWORD"
echo "Devpi initialized successfully"
fi
# Build command
CMD="devpi-server --serverdir $SERVERDIR --host $HOST --port $PORT"
if [ -n "$OUTSIDE_URL" ]; then
CMD="$CMD --outside-url $OUTSIDE_URL"
fi
echo "Starting devpi-server..."
exec $CMD